pub struct Publisher<T>where
T: WrappedTypesupport,{ /* private fields */ }
Expand description
A ROS (typed) publisher.
This contains a Weak Arc
to a typed publisher. As such it is safe to
move between threads.
Implementations§
source§impl<T> Publisher<T>where
T: WrappedTypesupport + 'static,
impl<T> Publisher<T>where
T: WrappedTypesupport + 'static,
sourcepub fn publish(&self, msg: &T) -> Result<()>where
T: WrappedTypesupport,
pub fn publish(&self, msg: &T) -> Result<()>where
T: WrappedTypesupport,
Publish a ROS message.
pub fn borrow_loaned_message(&self) -> Result<WrappedNativeMsg<T>>where
T: WrappedTypesupport,
sourcepub fn publish_native(&self, msg: &mut WrappedNativeMsg<T>) -> Result<()>where
T: WrappedTypesupport,
pub fn publish_native(&self, msg: &mut WrappedNativeMsg<T>) -> Result<()>where
T: WrappedTypesupport,
Publish a “native” ROS message.
This function is useful if you want to bypass the generated rust types as it lets you work with the raw C struct.
sourcepub fn get_inter_process_subscription_count(&self) -> Result<usize>
pub fn get_inter_process_subscription_count(&self) -> Result<usize>
Gets the number of external subscribers (i.e. it doesn’t count subscribers from the same process).
Trait Implementations§
impl<T> Send for Publisher<T>where
T: WrappedTypesupport,
Auto Trait Implementations§
impl<T> Freeze for Publisher<T>
impl<T> RefUnwindSafe for Publisher<T>where
T: RefUnwindSafe,
impl<T> !Sync for Publisher<T>
impl<T> Unpin for Publisher<T>where
T: Unpin,
impl<T> UnwindSafe for Publisher<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more