Module shared

Source
Expand description

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§

ChannelReceiveFuture
A Future that is returned by the receive function on a channel. The future gets resolved with Some(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 to None.
ChannelSendFuture
A Future that is returned by the send function on a channel. The future gets resolved with None when a value could be written to the channel. If the channel gets closed the send operation will fail, and the Future will resolve to ChannelSendError(T) and return the item to send.
GenericOneshotBroadcastReceiver
The receiving side of a channel which can be used to exchange values between concurrent tasks.
GenericOneshotBroadcastSender
The sending side of a channel which can be used to exchange values between concurrent tasks.
GenericOneshotReceiver
The receiving side of a channel which can be used to exchange values between concurrent tasks.
GenericOneshotSender
The sending side of a channel which can be used to exchange values between concurrent tasks.
GenericReceiver
The receiving side of a channel which can be used to exchange values between concurrent tasks.
GenericSender
The sending side of a channel which can be used to exchange values between concurrent tasks.
GenericStateReceiver
The receiving side of a channel which can be used to exchange values between concurrent tasks.
GenericStateSender
The sending side of a channel which can be used to exchange values between concurrent tasks.
SharedStream
A stream that receives from channel using a GenericReceiver.
StateReceiveFuture
A Future that is returned by the receive function on a state broadcast channel. The future gets resolved with Some((state_id, state)) when a value could be received from the channel.

Functions§

channel
Creates a new channel with the given buffering capacity
generic_channel
Creates a new Channel which can be used to exchange values of type T between concurrent tasks. The ends of the Channel are represented through the returned Sender and Receiver. Both the Sender and Receiver can be cloned in order to let more tasks interact with the Channel.
generic_oneshot_broadcast_channel
Creates a new oneshot broadcast channel which can be used to exchange values of type T between concurrent tasks. The ends of the Channel are represented through the returned Sender and Receiver. The Receiver can be cloned.
generic_oneshot_channel
Creates a new oneshot channel which can be used to exchange values of type T between concurrent tasks. The ends of the Channel are represented through the returned Sender and Receiver.
generic_state_broadcast_channel
Creates a new state broadcast channel which can be used to exchange values of type T between concurrent tasks. The ends of the Channel are represented through the returned Sender and Receiver.
oneshot_broadcast_channel
Creates a new oneshot broadcast channel.
oneshot_channel
Creates a new oneshot channel.
state_broadcast_channel
Creates a new state broadcast channel.
unbuffered_channel
Creates a new unbuffered channel.

Type Aliases§

OneshotBroadcastReceiver
A GenericOneshotBroadcastReceiver implementation backed by parking_lot.
OneshotBroadcastSender
A GenericOneshotBroadcastSender implementation backed by parking_lot.
OneshotReceiver
A GenericOneshotReceiver implementation backed by parking_lot.
OneshotSender
A GenericOneshotSender implementation backed by parking_lot.
Receiver
A GenericReceiver implementation backed by parking_lot.
Sender
A GenericSender implementation backed by parking_lot.
StateReceiver
A GenericStateReceiver implementation backed by parking_lot.
StateSender
A GenericStateSender implementation backed by parking_lot.
UnbufferedReceiver
A GenericReceiver implementation backed by parking_lot.
UnbufferedSender
A GenericSender implementation backed by parking_lot.