Struct flume::Sender

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

A transmitting end of a channel.

Implementations§

Asynchronously send a value into the channel, returning an error if all receivers have been dropped. If the channel is bounded and is full, the returned future will yield to the async runtime.

In the current implementation, the returned future will not yield to the async runtime if the channel is unbounded. This may change in later versions.

Convert this sender into a future that asynchronously sends a single message into the channel, returning an error if all receivers have been dropped. If the channel is bounded and is full, this future will yield to the async runtime.

In the current implementation, the returned future will not yield to the async runtime if the channel is unbounded. This may change in later versions.

Create an asynchronous sink that uses this sender to asynchronously send messages into the channel. The sender will continue to be usable after the sink has been dropped.

In the current implementation, the returned sink will not yield to the async runtime if the channel is unbounded. This may change in later versions.

Convert this sender into a sink that allows asynchronously sending messages into the channel.

In the current implementation, the returned sink will not yield to the async runtime if the channel is unbounded. This may change in later versions.

Attempt to send a value into the channel. If the channel is bounded and full, or all receivers have been dropped, an error is returned. If the channel associated with this sender is unbounded, this method has the same behaviour as Sender::send.

Send a value into the channel, returning an error if all receivers have been dropped. If the channel is bounded and is full, this method will block until space is available or all receivers have been dropped. If the channel is unbounded, this method will not block.

Send a value into the channel, returning an error if all receivers have been dropped or the deadline has passed. If the channel is bounded and is full, this method will block until space is available, the deadline is reached, or all receivers have been dropped.

Send a value into the channel, returning an error if all receivers have been dropped or the timeout has expired. If the channel is bounded and is full, this method will block until space is available, the timeout has expired, or all receivers have been dropped.

Returns true if all receivers for this channel have been dropped.

Returns true if the channel is empty. Note: Zero-capacity channels are always empty.

Returns true if the channel is full. Note: Zero-capacity channels are always full.

Returns the number of messages in the channel

If the channel is bounded, returns its capacity.

Trait Implementations§

Clone this sender. Sender acts as a handle to the ending a channel. Remaining channel contents will only be cleaned up when all senders and the receiver have been dropped.

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.