Trait combine::primitives::RangeStream [] [src]

pub trait RangeStream: Stream + Positioner {
    fn uncons_range(self, size: usize) -> Result<(Self::Range, Self)Error<Self::Item, Self::Range>>;
    fn uncons_while<F>(self, f: F) -> Result<(Self::Range, Self)Error<Self::Item, Self::Range>> where F: FnMut(Self::Item) -> bool;
}

A RangeStream is an extension of Stream which allows for zero copy parsing

Required Methods

fn uncons_range(self, size: usize) -> Result<(Self::Range, Self)Error<Self::Item, Self::Range>>

Takes size elements from the stream Fails if the length of the stream is less than size.

fn uncons_while<F>(self, f: F) -> Result<(Self::Range, Self)Error<Self::Item, Self::Range>> where F: FnMut(Self::Item) -> bool

Takes items from stream, testing each one with predicate returns the range of items which passed predicate

Implementors