Module channel

Source
Expand description

async_std::channel re-exports and shims

Structs§

Channel
Channel struct that combines async_std::channel::Sender and async_std::channel::Receiver into a single struct with sender and receiver members representing a single channel.
ChannelIterator
DuplexChannel
DuplexChannel contains 2 channels request and response meant to provide for a request/response pattern. This is useful for any type of signaling, but especially during task termination, where you can request a task to terminate and wait for a response confirming its termination.
Multiplexer
A simple MPMC (one to many) channel Multiplexer that broadcasts to multiple registered receivers. Multiplexer<T> itself can be cloned and used to broadcast using Multiplexer::broadcast() or Multiplexer::try_broadcast(). To create a receiving channel, you can call MultiplexerChannel<T>::from() and supply the desired Multiplexer instance, or simply call Multiplexer::channel() to create a new MultiplexerChannel instance. The receiving channel gets unregistered when MultiplexerChannel is dropped or the underlying Receiver is closed.
MultiplexerChannel
Receiving channel endpoint for the Multiplexer. MultiplexerChannel<T> holds a Sender and the Receiver channel endpoints. The Sender is provided for convenience, allowing internal relay within this channel instance. To process events, simply iterate over MultiplexerChannel::recv() by calling channel.recv().await.
Receiver
The receiving side of a channel.
RecvError
An error returned from Receiver::recv().
SendError
An error returned from Sender::send().
Sender
The sending side of a channel.

Enums§

ChannelError
TryRecvError
An error returned from Receiver::try_recv().
TrySendError
An error returned from Sender::try_send().

Functions§

bounded
Creates a bounded channel.
oneshot
Creates a oneshot channel (bounded channel with a limit of 1 message)
unbounded
Creates an unbounded channel.