pub struct BroadcastSender<T> { /* private fields */ }Expand description
Public interface for a broadcast queue sender
Implementations§
Source§impl<T> BroadcastSender<T>where
T: Clone,
impl<T> BroadcastSender<T>where
T: Clone,
Sourcepub async fn send_async(&self, item: T) -> Result<(), SendError<T>>
pub async fn send_async(&self, item: T) -> Result<(), SendError<T>>
Asynchronously sends a value to all connected receivers
§Errors
Will return Err if one of the downstream receivers was disconnected without being properly
dropped.
Sourcepub async fn handle_async(&self) -> BroadcastReceiver<T>
pub async fn handle_async(&self) -> BroadcastReceiver<T>
Asynchronously creates a new handle
Sourcepub fn handle_sync(&self) -> BroadcastReceiver<T>
pub fn handle_sync(&self) -> BroadcastReceiver<T>
Synchronously creates a new handle
Trait Implementations§
Source§impl<T: Clone> Clone for BroadcastSender<T>
impl<T: Clone> Clone for BroadcastSender<T>
Source§fn clone(&self) -> BroadcastSender<T>
fn clone(&self) -> BroadcastSender<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BroadcastSender<T>
impl<T> !RefUnwindSafe for BroadcastSender<T>
impl<T> Send for BroadcastSender<T>where
T: Send,
impl<T> Sync for BroadcastSender<T>where
T: Send,
impl<T> Unpin for BroadcastSender<T>
impl<T> !UnwindSafe for BroadcastSender<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