pub trait UnindexedConsumer<I>: Consumer<I> {
fn split_off_left(&self) -> Self;
fn to_reducer(&self) -> Self::Reducer;
}
Expand description
A stateless consumer can be freely copied. These consumers can be
used like regular consumers, but they also support a
split_off_left
method that does not take an index to split, but
simply splits at some arbitrary point (for_each
, for example,
produces an unindexed consumer).
Required Methods
sourcefn split_off_left(&self) -> Self
fn split_off_left(&self) -> Self
Splits off a “left” consumer and returns it. The self
consumer should then be used to consume the “right” portion of
the data. (The ordering matters for methods like find_first –
values produced by the returned value are given precedence
over values produced by self
.) Once the left and right
halves have been fully consumed, you should reduce the results
with the result of to_reducer
.
sourcefn to_reducer(&self) -> Self::Reducer
fn to_reducer(&self) -> Self::Reducer
Creates a reducer that can be used to combine the results from a split consumer.