[][src]Struct suspend::Sender

pub struct Sender<T> { /* fields omitted */ }

A oneshot::Sender used to provide a single asynchronous result. Requires the oneshot feature.

Implementations

impl<T> Sender<T>[src]

A oneshot::Sender used to provide a single asynchronous result. Requires the oneshot feature.

pub fn send(self, message: T) -> Result<(), SendError<T>>[src]

Sends message over the channel to the corresponding Receiver.

Returns an error if the receiver has already been dropped. The message can be extracted from the error.

This method is completely lock-free and wait-free when sending on a channel that the receiver is currently not receiving on. If the receiver is receiving during the send operation this method includes waking up the thread/task. Unparking a thread currently involves a mutex in Rust's standard library. How lock-free waking up an async task is depends on your executor. If this method returns a SendError, please mind that dropping the error involves running any drop implementation on the message type, which might or might not be lock-free.

Trait Implementations

impl<T> Debug for Sender<T> where
    T: Debug
[src]

impl<T> Drop for Sender<T>[src]

impl<T> Send for Sender<T> where
    T: Send
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Sender<T>

impl<T> !Sync for Sender<T>

impl<T> Unpin for Sender<T>

impl<T> !UnwindSafe for Sender<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.