Skip to main content

Module channel

Module channel 

Source
Expand description

A bounded channel with any number of senders and receivers, for the stdio channels of the containers and the stdin of their attach clients.

Unlike the mpsc channel of tokio, its receivers can be cloned and closed through a shared reference, and a sender can push out the oldest message of a full channel instead of waiting, see Sender::force_send. The messages stay in the order they got sent, every message goes to one of the receivers.

Structsยง

Channel ๐Ÿ”’
The state shared by the senders and receivers of a channel.
Receiver ๐Ÿ”’
The receiving half of a channel, whose clones share the messages.
RecvError ๐Ÿ”’
The channel is empty and got closed, or all senders are gone.
SendError ๐Ÿ”’
The channel got closed or all receivers are gone, with the message which could not be sent.
Sender ๐Ÿ”’
The sending half of a channel.
State ๐Ÿ”’

Enumsยง

Push ๐Ÿ”’
Why a message could not be queued.
TryRecvError ๐Ÿ”’
Why Receiver::try_recv got no message.

Functionsยง

bounded ๐Ÿ”’
Create a channel which holds up to capacity messages, which must not be zero.