Expand description
Asynchronous channels.
This module provides various channels that can be used to communicate between asynchronous tasks.
Modules§
- shared
- Channel implementations where Sender and Receiver sides are cloneable and owned. The Futures produced by channels in this module don’t require a lifetime parameter.
Structs§
- Channel
Receive Future - A Future that is returned by the
receive
function on a channel. The future gets resolved withSome(value)
when a value could be received from the channel. If the channels gets closed and no items are still enqueued inside the channel, the future will resolve toNone
. - Channel
Send Error - The error which is returned when sending a value into a channel fails.
- Channel
Send Future - A Future that is returned by the
send
function on a channel. The future gets resolved withNone
when a value could be written to the channel. If the channel gets closed the send operation will fail, and the Future will resolve toChannelSendError(T)
and return the item to send. - Channel
Stream - A stream that receives from a
GenericChannel
. - Generic
Channel - A channel which can be used to exchange values of type
T
between concurrent tasks. - Generic
Oneshot Broadcast Channel - A channel which can be used to exchange a single value between two or more concurrent tasks.
- Generic
Oneshot Channel - A channel which can be used to exchange a single value between two concurrent tasks.
- Generic
State Broadcast Channel - A channel which can be used to synchronize the state between a sender an arbitrary number of receivers.
- StateId
- An ID, which allows to differentiate states received from a Channel.
Elements with a bigger state ID (
id > otherId
) have been published more recently into the Channel. - State
Receive Future - A Future that is returned by the
receive
function on a state broadcast channel. The future gets resolved withSome((state_id, state))
when a value could be received from the channel.
Enums§
- Close
Status - Conveys additional information regarding the status of a channel
following a
close
operation. - TryReceive
Error - The error which is returned when trying to receive from a channel without waiting fails.
- TrySend
Error - The error which is returned when trying to send on a channel without waiting fails.
Type Aliases§
- Channel
- A
GenericChannel
implementation backed byparking_lot
. - Local
Channel - A
GenericChannel
implementation which is not thread-safe. - Local
Oneshot Broadcast Channel - A
GenericOneshotBroadcastChannel
which is not thread-safe. - Local
Oneshot Channel - A
GenericOneshotChannel
which is not thread-safe. - Local
State Broadcast Channel - A
GenericStateBroadcastChannel
which is not thread-safe. - Local
Unbuffered Channel - An unbuffered
GenericChannel
implementation which is not thread-safe. - Oneshot
Broadcast Channel - A
GenericOneshotBroadcastChannel
implementation backed byparking_lot
. - Oneshot
Channel - A
GenericOneshotChannel
implementation backed byparking_lot
. - State
Broadcast Channel - A
GenericStateBroadcastChannel
implementation backed byparking_lot
. - Unbuffered
Channel - An unbuffered
GenericChannel
implementation backed byparking_lot
.