pub struct TopicListener<T>where
T: Topicable,{ /* private fields */ }Expand description
Listener attached to a Topic<T>.
Implementations§
Source§impl<T> TopicListener<T>where
T: Topicable,
impl<T> TopicListener<T>where
T: Topicable,
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new TopicListener<T> with no callbacks registered.
§Examples
use cyclonedds::TopicListener;
let listener = TopicListener::<Data>::new();Sourcepub fn with_inconsistent_topic(
self,
callback: fn(&Topic<'_, '_, T>, InconsistentTopic),
) -> Self
pub fn with_inconsistent_topic( self, callback: fn(&Topic<'_, '_, T>, InconsistentTopic), ) -> Self
Sets a callback for the
InconsistentTopic status event.
The callback receives an
InconsistentTopic metadata struct.
Fired when a remote topic is discovered with the same name but an
incompatible type or QoS.
§Examples
use cyclonedds::listener::TopicListener;
let listener =
TopicListener::<Data>::new().with_inconsistent_topic(|topic, inconsistent_topic| {
println!("inconsistent topic: {inconsistent_topic:?}");
});Trait Implementations§
Source§impl<T> AsRef<TopicListener<T>> for TopicListener<T>where
T: Topicable,
impl<T> AsRef<TopicListener<T>> for TopicListener<T>where
T: Topicable,
Source§fn as_ref(&self) -> &TopicListener<T>
fn as_ref(&self) -> &TopicListener<T>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<T> Clone for TopicListener<T>
impl<T> Clone for TopicListener<T>
Source§fn clone(&self) -> TopicListener<T>
fn clone(&self) -> TopicListener<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T> Copy for TopicListener<T>
Source§impl<T> Debug for TopicListener<T>
impl<T> Debug for TopicListener<T>
Auto Trait Implementations§
impl<T> Freeze for TopicListener<T>
impl<T> RefUnwindSafe for TopicListener<T>
impl<T> Send for TopicListener<T>
impl<T> Sync for TopicListener<T>
impl<T> Unpin for TopicListener<T>
impl<T> UnsafeUnpin for TopicListener<T>
impl<T> UnwindSafe for TopicListener<T>
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