pub struct BroadcastSystem { /* private fields */ }Expand description
Broadcast system
Implementations§
Source§impl BroadcastSystem
impl BroadcastSystem
Sourcepub fn new(config: BroadcastConfig) -> Self
pub fn new(config: BroadcastConfig) -> Self
Create a new broadcast system
Sourcepub async fn subscribe(
&self,
topic: String,
subscriber: ConnectionId,
) -> Result<()>
pub async fn subscribe( &self, topic: String, 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 async fn publish(&self, topic: &str, message: Message) -> Result<usize>
pub async fn publish(&self, topic: &str, message: Message) -> Result<usize>
Publish a message to a topic
Sourcepub fn room_manager(&self) -> &Arc<RoomManager>
pub fn room_manager(&self) -> &Arc<RoomManager>
Get room manager
Sourcepub fn router(&self) -> &Arc<MessageRouter>
pub fn router(&self) -> &Arc<MessageRouter>
Get message router
Sourcepub async fn stats(&self) -> BroadcastStats
pub async fn stats(&self) -> BroadcastStats
Get broadcast statistics
Auto Trait Implementations§
impl Freeze for BroadcastSystem
impl !RefUnwindSafe for BroadcastSystem
impl Send for BroadcastSystem
impl Sync for BroadcastSystem
impl Unpin for BroadcastSystem
impl UnsafeUnpin for BroadcastSystem
impl !UnwindSafe for BroadcastSystem
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