[−][src]Trait combine::stream::StreamOnce
StreamOnce
represents a sequence of items that can be extracted one by one.
Associated Types
type Item: Clone + PartialEq
The type of items which is yielded from this stream.
type Range: Clone + PartialEq
The type of a range of items yielded from this stream.
Types which do not a have a way of yielding ranges of items should just use the
Self::Item
for this type.
type Position: Clone + Ord
Type which represents the position in a stream.
Ord
is required to allow parsers to determine which of two positions are further ahead.
type Error: ParseError<Self::Item, Self::Range, Self::Position>
Required methods
fn uncons(&mut self) -> Result<Self::Item, StreamErrorFor<Self>>
Takes a stream and removes its first item, yielding the item and the rest of the elements.
Returns Err
if no element could be retrieved.
Provided methods
fn is_partial(&self) -> bool
Returns true
if this stream only contains partial input.
See PartialStream
.
Implementations on Foreign Types
impl<'a> StreamOnce for &'a str
[src]
type Item = char
type Range = &'a str
type Position = PointerOffset
type Error = StringStreamError
fn uncons(&mut self) -> Result<char, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<'a, T> StreamOnce for &'a [T] where
T: Clone + PartialEq,
[src]
T: Clone + PartialEq,
type Item = T
type Range = &'a [T]
type Position = PointerOffset
type Error = UnexpectedParse
fn uncons(&mut self) -> Result<T, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
Implementors
impl<'a, T> StreamOnce for SliceStream<'a, T> where
T: PartialEq + 'a,
[src]
T: PartialEq + 'a,
type Item = &'a T
type Range = &'a [T]
type Position = PointerOffset
type Error = UnexpectedParse
fn uncons(&mut self) -> Result<&'a T, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<I> StreamOnce for BufferedStream<I> where
I: StreamOnce + Positioned,
I::Item: Clone + PartialEq,
[src]
I: StreamOnce + Positioned,
I::Item: Clone + PartialEq,
type Item = I::Item
type Range = I::Range
type Position = I::Position
type Error = I::Error
fn uncons(&mut self) -> Result<I::Item, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<I, X, S> StreamOnce for State<I, X> where
I: StreamOnce,
X: Positioner<I::Item>,
S: StreamError<I::Item, I::Range>,
I::Error: ParseError<I::Item, I::Range, X::Position, StreamError = S>,
I::Error: ParseError<I::Item, I::Range, I::Position, StreamError = S>,
[src]
I: StreamOnce,
X: Positioner<I::Item>,
S: StreamError<I::Item, I::Range>,
I::Error: ParseError<I::Item, I::Range, X::Position, StreamError = S>,
I::Error: ParseError<I::Item, I::Range, I::Position, StreamError = S>,
type Item = I::Item
type Range = I::Range
type Position = X::Position
type Error = I::Error
fn uncons(&mut self) -> Result<I::Item, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<I: Iterator> StreamOnce for IteratorStream<I> where
I::Item: Clone + PartialEq,
[src]
I::Item: Clone + PartialEq,
type Item = I::Item
type Range = I::Item
type Position = ()
type Error = UnexpectedParse
fn uncons(&mut self) -> Result<I::Item, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<R: Read> StreamOnce for ReadStream<R>
[src]
type Item = u8
type Range = u8
type Position = usize
type Error = Errors<u8, u8, usize>
fn uncons(&mut self) -> Result<u8, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<S> StreamOnce for Stream<S> where
S: StreamOnce + Positioned,
[src]
S: StreamOnce + Positioned,
type Item = S::Item
type Range = S::Range
type Position = S::Position
type Error = ParseError<S>
fn uncons(&mut self) -> Result<Self::Item, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<S> StreamOnce for PartialStream<S> where
S: StreamOnce,
[src]
S: StreamOnce,