Expand description
This utility wraps a Sender and Receiver, providing lightweight sub-channels keyed by Channel.
Usage:
- Call Muxer::new to obtain a (Muxer, MuxHandle) pair.
- Call Muxer::start or run Muxer::run in a background task to demux incoming messages into per-subchannel queues.
- Call MuxHandle::register to obtain a (SubSender, SubReceiver) pair for that subchannel, even if the muxer is already running.
Structs§
- Global
Sender - Sender that can send messages over any sub Channel.
- MuxHandle
- A clonable handle that allows registering routes at any time, even after the Muxer is running.
- Muxer
- A multiplexer of p2p channels into subchannels.
- Muxer
Builder - A builder that constructs a Muxer.
- Muxer
Builder AllOpts - A builder that constructs a Muxer with a GlobalSender and backup channel.
- Muxer
Builder With Backup - A builder that constructs a Muxer with a backup channel.
- Muxer
Builder With Global Sender - A builder that constructs a Muxer with a GlobalSender.
- SubReceiver
- Receiver that yields messages for a specific subchannel.
- SubSender
- Sender that routes messages to the
subchannel.
Enums§
- Error
- Errors that can occur when interacting with a SubReceiver or MuxHandle.
Traits§
- Builder
- A generic builder interface.