Trait rayon::iter::plumbing::UnindexedProducer

source ·
pub trait UnindexedProducer: Send + Sized {
    type Item;

    // Required methods
    fn split(self) -> (Self, Option<Self>);
    fn fold_with<F>(self, folder: F) -> F
       where F: Folder<Self::Item>;
}
Expand description

A variant on Producer which does not know its exact length or cannot represent it in a usize. These producers act like ordinary producers except that they cannot be told to split at a particular point. Instead, you just ask them to split ‘somewhere’.

(In principle, Producer could extend this trait; however, it does not because to do so would require producers to carry their own length with them.)

Required Associated Types§

source

type Item

The type of item returned by this producer.

Required Methods§

source

fn split(self) -> (Self, Option<Self>)

Split midway into a new producer if possible, otherwise return None.

source

fn fold_with<F>(self, folder: F) -> F
where F: Folder<Self::Item>,

Iterate the producer, feeding each element to folder, and stop when the folder is full (or all elements have been consumed).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl UnindexedProducer for IterProducer<i64>

source§

impl UnindexedProducer for IterProducer<i128>

source§

impl UnindexedProducer for IterProducer<u64>

source§

impl UnindexedProducer for IterProducer<u128>

source§

impl<'a, D, S> UnindexedProducer for rayon::iter::splitter::SplitProducer<'a, D, S>
where D: Send, S: Fn(D) -> (D, Option<D>) + Sync,

source§

type Item = D

source§

impl<'ch> UnindexedProducer for BytesProducer<'ch>

source§

impl<'ch> UnindexedProducer for CharIndicesProducer<'ch>

source§

impl<'ch> UnindexedProducer for CharsProducer<'ch>

source§

impl<'ch> UnindexedProducer for EncodeUtf16Producer<'ch>

source§

impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchIndicesProducer<'ch, 'pat, P>

source§

type Item = (usize, &'ch str)

source§

impl<'ch, 'pat, P: Pattern> UnindexedProducer for MatchesProducer<'ch, 'pat, P>

source§

type Item = &'ch str

source§

impl<'ch, 'sep, P: Pattern + 'sep> UnindexedProducer for SplitTerminatorProducer<'ch, 'sep, P>

source§

type Item = &'ch str

source§

impl<'p, P, V, const INCL: bool> UnindexedProducer for rayon::split_producer::SplitProducer<'p, P, V, INCL>
where V: Fissile<P> + Send, P: Sync,

source§

type Item = V

source§

impl<Iter: Iterator + Send> UnindexedProducer for &IterParallelProducer<'_, Iter>

source§

type Item = <Iter as Iterator>::Item

source§

impl<S, B, I> UnindexedProducer for WalkTreePostfixProducer<'_, S, B>
where S: Send, B: Fn(&S) -> I + Send + Sync, I: IntoIterator<Item = S>,

source§

type Item = S

source§

impl<S, B, I> UnindexedProducer for WalkTreePrefixProducer<'_, S, B>
where S: Send, B: Fn(&S) -> I + Send + Sync, I: IntoIterator<Item = S>, I::IntoIter: DoubleEndedIterator,

source§

type Item = S

source§

impl<T, Slice, Pred> UnindexedProducer for ChunkByProducer<'_, T, Slice, Pred>
where Slice: ChunkBySlice<T>, Pred: Fn(&T, &T) -> bool + Send + Sync,

source§

type Item = Slice

source§

impl<T: Clone + Send> UnindexedProducer for RepeatProducer<T>

source§

type Item = T