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

pub trait RangeStream: Stream {
    fn uncons_range(&mut self, size: usize) -> Result<Self::Range, Error<Self::Item, Self::Range>>;
    fn uncons_while<F>(&mut self, f: F) -> Result<Self::Range, 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(&mut self, size: usize) -> Result<Self::Range, 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>(&mut self, f: F) -> Result<Self::Range, 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