pub struct TopicRouter<T> { /* private fields */ }
Implementations§
Source§impl<T> TopicRouter<T>
impl<T> TopicRouter<T>
pub fn new() -> TopicRouter<T>
pub fn add_subscription( &mut self, topic: TopicPatternPath, qos: QoS, subscription: T, ) -> (bool, SubscriptionId)
pub fn unsubscribe( &mut self, id: &SubscriptionId, ) -> Result<(bool, TopicPatternPath), TopicRouterError>
pub fn get_subscribers<'a>( &'a self, topic: &TopicPath, ) -> Vec<(&'a SubscriptionId, &'a (TopicPatternPath, QoS), &'a T)>
pub fn get_active_subscriptions( &self, ) -> impl Iterator<Item = &(TopicPatternPath, QoS)>
Sourcepub fn get_topics_for_unsubscribe(&self) -> HashSet<ArcStr>
pub fn get_topics_for_unsubscribe(&self) -> HashSet<ArcStr>
Get all unique active topic patterns
Sourcepub fn get_topics_for_resubscribe(&self) -> HashMap<ArcStr, QoS>
pub fn get_topics_for_resubscribe(&self) -> HashMap<ArcStr, QoS>
Get all active topic patterns with their maximum QoS Returns unique topics (grouped by pattern) with the highest QoS among all subscribers
Sourcepub fn cleanup(&mut self)
pub fn cleanup(&mut self)
Cleanup all internal data structures and close subscriber channels This method is called during shutdown to ensure proper resource cleanup
pub fn get_topic_by_id( &self, id: &SubscriptionId, ) -> Result<&(TopicPatternPath, QoS), TopicRouterError>
Trait Implementations§
Source§impl<T> Default for TopicRouter<T>
impl<T> Default for TopicRouter<T>
Source§fn default() -> TopicRouter<T>
fn default() -> TopicRouter<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for TopicRouter<T>
impl<T> RefUnwindSafe for TopicRouter<T>where
T: RefUnwindSafe,
impl<T> Send for TopicRouter<T>where
T: Send,
impl<T> Sync for TopicRouter<T>where
T: Sync,
impl<T> Unpin for TopicRouter<T>where
T: Unpin,
impl<T> UnwindSafe for TopicRouter<T>where
T: UnwindSafe,
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