pub struct Broadcast<T>where
T: BroadcastTrait,{ /* private fields */ }
Expand description
Represents a broadcast mechanism for sending messages to multiple receivers.
This struct encapsulates the core components required for broadcasting, including the capacity of the broadcast channel and the sender responsible for dispatching messages.
Implementations§
Source§impl<T> Broadcast<T>where
T: BroadcastTrait,
Implements core functionalities for the Broadcast
struct.
impl<T> Broadcast<T>where
T: BroadcastTrait,
Implements core functionalities for the Broadcast
struct.
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Retrieves the current number of active receivers subscribed to this broadcast channel.
§Returns
ReceiverCount
- The total count of active receivers.
Trait Implementations§
Source§impl<T> Default for Broadcast<T>where
T: BroadcastTrait,
Provides a default implementation for Broadcast
instances.
impl<T> Default for Broadcast<T>where
T: BroadcastTrait,
Provides a default implementation for Broadcast
instances.
The default broadcast channel is initialized with a predefined sender capacity.
Auto Trait Implementations§
impl<T> Freeze for Broadcast<T>
impl<T> !RefUnwindSafe for Broadcast<T>
impl<T> Send for Broadcast<T>where
T: Send,
impl<T> Sync for Broadcast<T>where
T: Send,
impl<T> Unpin for Broadcast<T>
impl<T> !UnwindSafe for Broadcast<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