pub struct MultiChannelManager { /* private fields */ }Expand description
Multi-topic channel manager
Implementations§
Source§impl MultiChannelManager
impl MultiChannelManager
Sourcepub fn new(default_config: ChannelConfig) -> Self
pub fn new(default_config: ChannelConfig) -> Self
Create a new multi-channel manager
Sourcepub fn get_or_create(&self, topic: &str) -> Arc<TopicChannel>
pub fn get_or_create(&self, topic: &str) -> Arc<TopicChannel>
Get or create a channel
Sourcepub async fn subscribe(
&self,
topic: &str,
subscriber: ConnectionId,
) -> Result<()>
pub async fn subscribe( &self, topic: &str, subscriber: ConnectionId, ) -> Result<()>
Subscribe to a topic
Sourcepub async fn unsubscribe(
&self,
topic: &str,
subscriber: &ConnectionId,
) -> Result<()>
pub async fn unsubscribe( &self, topic: &str, subscriber: &ConnectionId, ) -> Result<()>
Unsubscribe from a topic
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Get channel count
Sourcepub fn remove_channel(&self, topic: &str) -> Option<Arc<TopicChannel>>
pub fn remove_channel(&self, topic: &str) -> Option<Arc<TopicChannel>>
Remove a channel
Auto Trait Implementations§
impl Freeze for MultiChannelManager
impl !RefUnwindSafe for MultiChannelManager
impl Send for MultiChannelManager
impl Sync for MultiChannelManager
impl Unpin for MultiChannelManager
impl UnsafeUnpin for MultiChannelManager
impl !UnwindSafe for MultiChannelManager
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