Struct ros2_client::Publisher

source ·
pub struct Publisher<M: Serialize> { /* private fields */ }
Expand description

A ROS2 Publisher

Corresponds to a simplified DataWriterin DDS

Implementations§

source§

impl<M: Serialize> Publisher<M>

source

pub fn publish(&self, message: M) -> WriteResult<(), M>

source

pub fn assert_liveliness(&self) -> WriteResult<(), ()>

source

pub fn guid(&self) -> GUID

source

pub fn gid(&self) -> Gid

source

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.

source

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.

source

pub async fn async_publish(&self, message: M) -> WriteResult<(), M>

Auto Trait Implementations§

§

impl<M> !Freeze for Publisher<M>

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V