Trait rayon::iter::plumbing::UnindexedConsumer
source · pub trait UnindexedConsumer<I>: Consumer<I> {
// Required methods
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.
Object Safety§
Implementors§
impl UnindexedConsumer<char> for ListStringConsumer
impl<'a, T, C> UnindexedConsumer<&'a T> for ClonedConsumer<C>where
C: UnindexedConsumer<T>,
T: 'a + Clone,
impl<'a, T, C> UnindexedConsumer<&'a T> for CopiedConsumer<C>where
C: UnindexedConsumer<T>,
T: 'a + Copy,
impl<'a, T, C> UnindexedConsumer<T> for PanicFuseConsumer<'a, C>where
C: UnindexedConsumer<T>,
impl<'a, T, OP, CA, CB> UnindexedConsumer<T> for UnzipConsumer<'a, OP, CA, CB>
impl<'c, T: Send + 'c> UnindexedConsumer<T> for CollectConsumer<'c, T>
Pretend to be unindexed for special_collect_into_vec
,
but we should never actually get used that way…