Module channel

Module channel 

Source
Expand description

Abstraction over channels. This will expose the following types:

Which channel is selected depends on these feature flags:

Note that exactly 1 of these features must be enabled. If 0 or 2+ are selected, you’ll get compiler errors.

Some of these implementations may not exist under the crate selected, in those cases they will be shimmed to another channel. e.g. oneshot might be implemented as bounded(1).

Structs§

BoundedStream
A bounded stream, created with a channel
OneShotReceiver
A single-use sender, created with oneshot
OneShotRecvError
An error returned from Receiver::recv().
OneShotSender
A single-use sender, created with oneshot
Receiver
A bounded receiver, created with [channel]
RecvError
An error returned from Receiver::recv().
SendError
An error returned from Sender::send().
Sender
A bounded sender, created with [channel]
UnboundedReceiver
An unbounded receiver, created with unbounded
UnboundedRecvError
An error returned from Receiver::recv().
UnboundedSendError
An error returned from Sender::send().
UnboundedSender
An unbounded sender, created with unbounded
UnboundedStream
An unbounded stream, created with a channel

Enums§

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

Functions§

bounded
Create a bounded sender/receiver pair, limited to len messages at a time.
oneshot
Create a single-use channel. Under water this might be implemented as a bounded(1), but more efficient implementations might exist.
unbounded
Create an unbounded channel. This will dynamically allocate whenever the internal buffer is full and a new message is added.