[−][src]Trait combine::StreamOnce
StreamOnce
represents a sequence of items that can be extracted one by one.
Associated Types
type Token: Clone
[src]
The type of items which is yielded from this stream.
type Range: Clone
[src]
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 Position: Clone + Ord
[src]
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::Token, Self::Range, Self::Position>
[src]
Required methods
pub 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
pub fn is_partial(&self) -> bool
[src]
Returns true
if this stream only contains partial input.
See PartialStream
.
Implementations on Foreign Types
impl<'a, I: ?Sized> StreamOnce for &'a mut I where
I: StreamOnce,
[src]
I: StreamOnce,
type Token = I::Token
type Range = I::Range
type Position = I::Position
type Error = I::Error
pub fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<'a> StreamOnce for &'a str
[src]
type Token = char
type Range = &'a str
type Position = PointerOffset<str>
type Error = StringStreamError
pub fn uncons(&mut self) -> Result<char, StreamErrorFor<Self>>
[src]
impl<'a, T> StreamOnce for &'a [T] where
T: Clone + PartialEq,
[src]
T: Clone + PartialEq,
type Token = T
type Range = &'a [T]
type Position = PointerOffset<[T]>
type Error = UnexpectedParse
pub fn uncons(&mut self) -> Result<T, StreamErrorFor<Self>>
[src]
Implementors
impl<'a, T> StreamOnce for SliceStream<'a, T> where
T: PartialEq + 'a,
[src]
T: PartialEq + 'a,
type Token = &'a T
type Range = &'a [T]
type Position = PointerOffset<[T]>
type Error = UnexpectedParse
pub fn uncons(&mut self) -> Result<&'a T, StreamErrorFor<Self>>
[src]
impl<Input> StreamOnce for combine::stream::buffered::Stream<Input> where
Input: StreamOnce + Positioned,
Input::Token: Clone,
[src]
Input: StreamOnce + Positioned,
Input::Token: Clone,
This is supported on crate feature
std
only.type Token = Input::Token
type Range = Input::Range
type Position = Input::Position
type Error = Input::Error
pub fn uncons(&mut self) -> Result<Input::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[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]
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>,
type Token = Input::Token
type Range = Input::Range
type Position = X::Position
type Error = Input::Error
pub fn uncons(&mut self) -> Result<Input::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<Input: Iterator> StreamOnce for IteratorStream<Input> where
Input::Item: Clone + PartialEq,
[src]
Input::Item: Clone + PartialEq,
type Token = Input::Item
type Range = Input::Item
type Position = ()
type Error = UnexpectedParse
pub fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>
[src]
impl<R: Read> StreamOnce for combine::stream::read::Stream<R>
[src]
This is supported on crate feature
std
only.type Token = u8
type Range = &'static [u8]
type Position = usize
type Error = Error
pub fn uncons(&mut self) -> Result<u8, StreamErrorFor<Self>>
[src]
impl<S> StreamOnce for combine::stream::easy::Stream<S> where
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq,
[src]
S: StreamOnce + Positioned,
S::Token: PartialEq,
S::Range: PartialEq,
This is supported on crate feature
std
only.type Token = S::Token
type Range = S::Range
type Position = S::Position
type Error = ParseError<S>
pub fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<S> StreamOnce for CompleteStream<S> where
S: StreamOnce,
[src]
S: StreamOnce,
type Token = S::Token
type Range = S::Range
type Position = S::Position
type Error = S::Error
pub fn uncons(&mut self) -> Result<S::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<S> StreamOnce for MaybePartialStream<S> where
S: StreamOnce,
[src]
S: StreamOnce,
type Token = S::Token
type Range = S::Range
type Position = S::Position
type Error = S::Error
pub fn uncons(&mut self) -> Result<S::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<S> StreamOnce for PartialStream<S> where
S: StreamOnce,
[src]
S: StreamOnce,
type Token = S::Token
type Range = S::Range
type Position = S::Position
type Error = S::Error
pub fn uncons(&mut self) -> Result<S::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[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]
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>,
type Token = S::Token
type Range = S::Range
type Position = Span<S::Position>
type Error = E
pub fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>
[src]
pub fn is_partial(&self) -> bool
[src]
impl<S, U> StreamOnce for combine::stream::state::Stream<S, U> where
S: StreamOnce,
[src]
S: StreamOnce,