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

Receiving side of the channel.

Implementations

Attempts to receive a value from this channel.

Returns a future that receives a value from the channel, waiting if the channel is empty.

If the returned Future returns None it means all Senders are disconnected. This is the same error as RecvError::Disconnected. RecvError::Empty will never be returned, the Future will return Poll::Pending instead.

Attempts to peek a value from this channel.

Returns a future that peeks at a value from the channel, waiting if the channel is empty.

If the returned Future returns None it means all Senders are disconnected. This is the same error as RecvError::Disconnected. RecvError::Empty will never be returned, the Future will return Poll::Pending instead.

Create a new Sender that sends to this channel.

Safety

The same restrictions apply to this function as they do to Sender::clone.

Returns the capacity of the channel.

Returns false if all Senders are disconnected.

Notes

Unlike Sender::is_connected this method doesn’t take the Manager into account. This means that this method can return false and later true (if the Manager created another Sender), which might be unexpected.

Returns true if the Manager is connected.

Set the receiver’s waker to waker, if they are different. Returns true if the waker is changed, false otherwise.

This is useful if you can’t call Receiver::recv but still want a wake-up notification once messages are added to the inbox.

Returns the id of this receiver.

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.