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) -> Fwhere 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).

Implementors§

source§

impl UnindexedProducer for IterProducer<i64>

§

type Item = i64

source§

impl UnindexedProducer for IterProducer<i128>

§

type Item = i128

source§

impl UnindexedProducer for IterProducer<u64>

§

type Item = u64

source§

impl UnindexedProducer for IterProducer<u128>

§

type Item = 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,

§

type Item = D

source§

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

§

type Item = u8

source§

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

§

type Item = (usize, char)

source§

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

§

type Item = char

source§

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

§

type Item = u16

source§

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

§

type Item = (usize, &'ch str)

source§

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

§

type Item = &'ch str

source§

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

§

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,

§

type Item = V

source§

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

§

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>,

§

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,

§

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,

§

type Item = Slice

source§

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

§

type Item = T