pub struct Broadcast<T>(/* private fields */)
where
T: BroadcastTrait;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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more