pub(crate) type SplitInclusiveProducer<'p, P, V> = SplitProducer<'p, P, V, true>;

Aliased Type§

struct SplitInclusiveProducer<'p, P, V> {
    data: V,
    separator: &'p P,
    tail: usize,
}

Fields§

§data: V§separator: &'p P§tail: usize

Marks the endpoint beyond which we’ve already found no separators.

Implementations§

source§

impl<'p, P, V> SplitProducer<'p, P, V, true>where V: Fissile<P> + Send,

source

pub(crate) fn new_incl(data: V, separator: &'p P) -> Self

source§

impl<'p, P, V, const INCL: bool> SplitProducer<'p, P, V, INCL>where V: Fissile<P> + Send,

source

pub(crate) fn fold_with<F>(self, folder: F, skip_last: bool) -> Fwhere F: Folder<V>,

Common fold_with implementation, integrating SplitTerminator’s need to sometimes skip its final empty item.

Trait Implementations§

source§

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

§

type Item = V

The type of item returned by this producer.
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).