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

Sending side of the channel.

Implementations

Attempts to send the value into the channel.

Returns a future that sends a value into the channel, waiting if the channel is full.

If the returned Future returns an error it means the Receiver and Manager are disconnected and no more values will be read from the channel. This is the same error as SendError::Disconnected. SendError::Full will never be returned, the Future will return Poll::Pending instead.

Returns a Future that waits until the other side of the channel is disconnected.

Returns the capacity of the channel.

Returns true if the Receiver and or the Manager are connected.

Notes

Unlike Receiver::is_connected this method takes the Manager into account. This is done to support the use case in which an actor is restarted and a new receiver is created for it.

Returns true if the Manager is connected.

Returns true if senders send into the same channel.

Returns true if this sender sends to the receiver.

Returns the id of this sender.

Trait Implementations

Safety

Only 2 ^ 30 (a billion) Senders may be alive concurrently, more then enough for all practical use cases.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.