pub struct Sender<T> { /* private fields */ }Expand description
Bounded sender. Clone-cheap (atomic refcount); multiple producers share the same channel buffer (no per-clone capacity inflation).
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>>
Send a value, awaiting channel capacity if full. Returns the
value back in SendError if the receiver has been dropped.
Sourcepub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
Synchronous send attempt.
pub fn is_closed(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>where
Sender<T>: RefUnwindSafe,
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnsafeUnpin for Sender<T>where
Sender<T>: UnsafeUnpin,
impl<T> UnwindSafe for Sender<T>where
Sender<T>: UnwindSafe,
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