Trait combine::RangeStreamOnce[][src]

pub trait RangeStreamOnce: StreamOnce + ResetStream {
    fn uncons_range(
        &mut self,
        size: usize
    ) -> Result<Self::Range, StreamErrorFor<Self>>;
fn uncons_while<F>(
        &mut self,
        f: F
    ) -> Result<Self::Range, StreamErrorFor<Self>>
    where
        F: FnMut(Self::Token) -> bool
;
fn distance(&self, end: &Self::Checkpoint) -> usize;
fn range(&self) -> Self::Range; fn uncons_while1<F>(
        &mut self,
        f: F
    ) -> ParseResult<Self::Range, StreamErrorFor<Self>>
    where
        F: FnMut(Self::Token) -> bool
, { ... } }
Expand description

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

Required methods

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

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

Returns the distance between self and end. The returned usize must be so that

let start = stream.checkpoint();
stream.uncons_range(distance);
stream.distance(&start) == distance

Returns the entire range of self

Provided methods

Takes items from stream, testing each one with predicate returns a range of at least one items which passed predicate.

Note

This may not return PeekOk as it should uncons at least one token.

Implementations on Foreign Types

Implementors