A channel's (Sender, Receiver) pair. Defines how the bus constructs and retrieves the values.
Channel endpoints can either be taken, or cloned. The
Channel trait has default implementations that honor the
Storage trait implementation of channel endpoints. However, in some cases (such as tokio broadcast channels) the tx & rx endpoints are both required to implement this trait.
The Sender half of the channel. This is used in
Message implementations to attach channels to a
The Receiver half of the channel. This is constructed when
bus.rx is called, and is driven by the
Message implementation for the message.
Constructs a new
(Sender, Receiver) pair. If the channel is bounded, use the provided capacity.
fn default_capacity() -> usize
If the channel is bounded, provide a default capacity hint. Users can override this with
Clones the Self::Tx value, or takes it from the option if this endpoint is not cloneable.
Clones the Self::Rx value, or takes it from the option if this endpoint is not cloneable. The Tx endpoint is also available, which is necessary to implement Channel for broadcast channels (where new receivers are created from a tx subscription call)