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

Implementations

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 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 involves a mutex in Rust’s standard library at the time of writing this. 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, and freeing the channel’s heap allocation, which might or might not be lock-free.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.