pub struct Sender<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T> Sender<T>
impl<T> Sender<T>
Sourcepub fn send(self, value: T) -> Result<(), T>
pub fn send(self, value: T) -> Result<(), T>
Sends the value and wakes the receiver. Never waits.
§Errors
Gives the value back when the receiver is closed or gone.
Sourcepub async fn closed(&mut self)
pub async fn closed(&mut self)
Completes when the receiver has been closed or dropped. Cancel safe.
Sourcepub fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()>
Polls whether the receiver has been closed or dropped; the waker of
cx is woken when it is.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Sender<T>
impl<T> !Send for Sender<T>
impl<T> !Sync for Sender<T>
impl<T> !UnwindSafe for Sender<T>
impl<T> Freeze for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnsafeUnpin 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