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>>
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
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
impl<I, E> RangeStream for State<I> where I: RangeStream<Item=E>,
I::Range: Range + Positioner<Position=E::Position>,
E: Positioner + Cloneimpl<'a> RangeStream for &'a str
impl<'a, T> RangeStream for &'a [T] where T: Clone + PartialEq
impl<'a, T> RangeStream for SliceStream<'a, T> where T: Clone + PartialEq + 'a