pub struct TopicTree { /* private fields */ }Expand description
Topic tree for managing subscriptions and retained messages
Implementations§
Source§impl TopicTree
impl TopicTree
pub fn new() -> Self
Sourcepub fn match_topic(&self, topic: &str) -> Vec<&Subscription>
pub fn match_topic(&self, topic: &str) -> Vec<&Subscription>
Match a topic against all subscriptions
Sourcepub fn unsubscribe(&mut self, filter: &str, client_id: &str)
pub fn unsubscribe(&mut self, filter: &str, client_id: &str)
Remove a subscription
Sourcepub fn retain_message(&mut self, topic: &str, payload: Vec<u8>, qos: u8)
pub fn retain_message(&mut self, topic: &str, payload: Vec<u8>, qos: u8)
Store a retained message
Sourcepub fn get_retained(&self, topic: &str) -> Option<&RetainedMessage>
pub fn get_retained(&self, topic: &str) -> Option<&RetainedMessage>
Get retained message for a topic
Sourcepub fn get_retained_for_filter(
&self,
filter: &str,
) -> Vec<(&str, &RetainedMessage)>
pub fn get_retained_for_filter( &self, filter: &str, ) -> Vec<(&str, &RetainedMessage)>
Get all retained messages that match a subscription filter
Sourcepub fn cleanup_expired_retained(&mut self, max_age_secs: u64)
pub fn cleanup_expired_retained(&mut self, max_age_secs: u64)
Clean up expired retained messages (basic implementation)
Sourcepub fn get_all_topic_filters(&self) -> Vec<String>
pub fn get_all_topic_filters(&self) -> Vec<String>
Get all topic filters (subscription patterns)
Sourcepub fn get_all_retained_topics(&self) -> Vec<String>
pub fn get_all_retained_topics(&self) -> Vec<String>
Get all retained message topics
Sourcepub fn stats(&self) -> TopicStats
pub fn stats(&self) -> TopicStats
Get topic statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TopicTree
impl RefUnwindSafe for TopicTree
impl Send for TopicTree
impl Sync for TopicTree
impl Unpin for TopicTree
impl UnwindSafe for TopicTree
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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