Struct mpmc_async::Sender
source · pub struct Sender<T>{ /* private fields */ }
Expand description
Producers messages to be read by Receivers.
Implementations§
source§impl<T> Sender<T>
impl<T> Sender<T>
sourcepub async fn send(&self, value: T) -> Result<(), SendError<T>>
pub async fn send(&self, value: T) -> Result<(), SendError<T>>
Waits until the value is sent or returns an when all receivers have been dropped.
sourcepub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
Sends without blocking or returns an when all receivers have been dropped.
sourcepub async fn reserve(&self) -> Result<Permit<T>, ReserveError>
pub async fn reserve(&self) -> Result<Permit<T>, ReserveError>
Waits until a permit is reserved or returns an when all receivers have been dropped.
sourcepub fn try_reserve(&self) -> Result<Permit<T>, TryReserveError>
pub fn try_reserve(&self) -> Result<Permit<T>, TryReserveError>
Reserves a permit or returns an when all receivers have been dropped.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnwindSafe for Sender<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