rayon::iter::plumbing

Trait 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§

Source

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.

Source

fn to_reducer(&self) -> Self::Reducer

Creates a reducer that can be used to combine the results from a split consumer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§