Struct rclrust::Subscription
source · [−]pub struct Subscription<T> where
T: MessageT, { /* private fields */ }
Expand description
Subscription
Implementations
sourceimpl<T> Subscription<T> where
T: MessageT,
impl<T> Subscription<T> where
T: MessageT,
sourcepub fn topic_name(&self) -> Option<String>
pub fn topic_name(&self) -> Option<String>
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");
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
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());
sourcepub fn publisher_count(&self) -> Result<usize>
pub fn publisher_count(&self) -> Result<usize>
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()?);
sourcepub fn actual_qos(&self) -> Option<QoSProfile>
pub fn actual_qos(&self) -> Option<QoSProfile>
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
impl<T> !RefUnwindSafe for Subscription<T>
impl<T> Send for Subscription<T>
impl<T> Sync for Subscription<T>
impl<T> Unpin for Subscription<T>
impl<T> !UnwindSafe for Subscription<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more