Struct ros2_client::Publisher
source · pub struct Publisher<M: Serialize> { /* private fields */ }
Expand description
A ROS2 Publisher
Corresponds to a simplified DataWriter
in
DDS
Implementations§
source§impl<M: Serialize> Publisher<M>
impl<M: Serialize> Publisher<M>
pub fn publish(&self, message: M) -> WriteResult<(), M>
pub fn assert_liveliness(&self) -> WriteResult<(), ()>
pub fn guid(&self) -> GUID
pub fn gid(&self) -> Gid
sourcepub fn get_subscription_count(&self, my_node: &Node) -> usize
pub fn get_subscription_count(&self, my_node: &Node) -> usize
Returns the count of currently matched subscribers.
my_node
must be the Node that created this Publisher, or the result is
undefined.
sourcepub async fn wait_for_subscription(&self, my_node: &Node)
pub async fn wait_for_subscription(&self, my_node: &Node)
Waits until there is at least one matched subscription on this topic, possibly forever.
my_node
must be the Node that created this Subscription, or the length
of the wait is undefined.
pub async fn async_publish(&self, message: M) -> WriteResult<(), M>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Publisher<M>
impl<M> Send for Publisher<M>where
M: Send,
impl<M> Sync for Publisher<M>where
M: Sync,
impl<M> Unpin for Publisher<M>where
M: Unpin,
impl<M> !UnwindSafe for Publisher<M>
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