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

Subscription

Implementations

Get the topic name which this subscritpion subscibes to.

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

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

Examples
let subscription =
    node.create_subscription::<Int32, _>("message", callback, &QoSProfile::default())?;
assert!(subscription.is_valid());

Get how many publisher are publishing the topic which this subscription subscribes to.

Examples
let subscription =
    node.create_subscription::<Int32, _>("message", callback, &QoSProfile::default())?;
println!("{}", subscription.publisher_count()?);

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

Examples
let subscription =
    node.create_subscription::<Int32, _>("message", callback, &QoSProfile::default())?;
println!("{:?}", subscription.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.