Skip to main content

Module demux_var

Module demux_var 

Source
Available on crate feature variadics only.
Expand description

DemuxVar push combinator for variadic demultiplexing.

Receives (usize, Item) pairs and dispatches each item to one of several downstream Pushes based on the index. The downstream pushes are stored as a variadic tuple (from the [variadics] crate) and accessed via the PushVariadic trait.

§Context handling

Each downstream push may have a different Push::Ctx type (especially when type-erased behind impl Push). The PushVariadic trait uses recursive Context::Merged to combine all downstream contexts into a single merged context type, then Context::unmerge_self / Context::unmerge_other to extract each push’s individual context.

Structs§

DemuxVar
Push combinator that dispatches (usize, Item) pairs to one of several downstream pushes based on the index.

Traits§

PushVariadic
A variadic of Pushes for use with DemuxVar.

Functions§

demux_var
Creates a DemuxVar push that dispatches each (usize, Item) pair to one of the downstream pushes in the given variadic, based on the index.