pub struct Publisher<T> where
    T: MessageT
{ /* private fields */ }
Expand description

Publisher

Implementations

Publish a message.

Examples
use rclrust_msg::std_msgs::msg::Int32;

let publisher = node.create_publisher::<Int32>("message", &QoSProfile::default())?;
publisher.publish(&Int32 { data: 42 })?;

Get the topic name which this publisher publishes on.

Examples
let publisher = node.create_publisher::<Int32>("message", &QoSProfile::default())?;
assert_eq!(&publisher.topic_name().unwrap(), "/message");

Check if this publisher is valid or not. Normally, a return value should be true.

Examples
let publisher = node.create_publisher::<Int32>("message", &QoSProfile::default())?;
assert!(publisher.is_valid());

Get how many subscriber are subscribing the topic which this publisher publishes on.

Examples
let publisher = node.create_publisher::<Int32>("message", &QoSProfile::default())?;
println!("{}", publisher.subscription_count()?);

Get the actual QoS settings, after the defaults have been determined.

Examples
let publisher = node.create_publisher::<Int32>("message", &QoSProfile::default())?;
println!("{:?}", publisher.actual_qos().unwrap());

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.