Trait combine::StreamOnce [−][src]
pub trait StreamOnce {
type Token: Clone;
type Range: Clone;
type Position: Clone + Ord;
type Error: ParseError<Self::Token, Self::Range, Self::Position>;
fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>;
fn is_partial(&self) -> bool { ... }
}Expand description
StreamOnce represents a sequence of items that can be extracted one by one.
Associated Types
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::Token for this type.
Type which represents the position in a stream.
Ord is required to allow parsers to determine which of two positions are further ahead.
Required methods
fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>[src]
fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>[src]Takes a stream and removes its first token, yielding the token and the rest of the elements.
Returns Err if no element could be retrieved.
Provided methods
fn is_partial(&self) -> bool[src]
fn is_partial(&self) -> bool[src]Returns true if this stream only contains partial input.
See PartialStream.
Implementations on Foreign Types
type Position = PointerOffset<str>type Error = StringStreamErrorImplementors
type Position = PointerOffset<[T]>type Error = UnexpectedParseimpl<Input> StreamOnce for combine::stream::buffered::Stream<Input> where
Input: StreamOnce + Positioned,
Input::Token: Clone, [src]
impl<Input> StreamOnce for combine::stream::buffered::Stream<Input> where
Input: StreamOnce + Positioned,
Input::Token: Clone, [src]This is supported on crate feature
std only.impl<Input, X, S> StreamOnce for combine::stream::position::Stream<Input, X> where
Input: StreamOnce,
X: Positioner<Input::Token>,
S: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S> + ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>, [src]
impl<Input, X, S> StreamOnce for combine::stream::position::Stream<Input, X> where
Input: StreamOnce,
X: Positioner<Input::Token>,
S: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S> + ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>, [src]impl<Input: Iterator> StreamOnce for IteratorStream<Input> where
Input::Item: Clone + PartialEq, [src]
impl<Input: Iterator> StreamOnce for IteratorStream<Input> where
Input::Item: Clone + PartialEq, [src]This is supported on crate feature
std only.impl<S> StreamOnce for combine::stream::easy::Stream<S> where
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq, [src]
impl<S> StreamOnce for combine::stream::easy::Stream<S> where
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq, [src]This is supported on crate feature
std only.impl<S, E> StreamOnce for combine::stream::span::Stream<S, E> where
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq,
E: ParseError<S::Token, S::Range, Span<S::Position>>,
S::Error: ParseErrorInto<S::Token, S::Range, S::Position>,
<S::Error as ParseError<S::Token, S::Range, S::Position>>::StreamError: StreamErrorInto<S::Token, S::Range>, [src]
impl<S, E> StreamOnce for combine::stream::span::Stream<S, E> where
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq,
E: ParseError<S::Token, S::Range, Span<S::Position>>,
S::Error: ParseErrorInto<S::Token, S::Range, S::Position>,
<S::Error as ParseError<S::Token, S::Range, S::Position>>::StreamError: StreamErrorInto<S::Token, S::Range>, [src]