[][src]Trait combine::StreamOnce

pub trait StreamOnce {
    type Token: Clone;
    type Range: Clone;
    type Position: Clone + Ord;
    type Error: ParseError<Self::Token, Self::Range, Self::Position>;
    pub fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>;

    pub fn is_partial(&self) -> bool { ... }
}

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]

Loading content...

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.

Loading content...

Provided methods

pub fn is_partial(&self) -> bool[src]

Returns true if this stream only contains partial input.

See PartialStream.

Loading content...

Implementations on Foreign Types

impl<'a, I: ?Sized> StreamOnce for &'a mut I where
    I: StreamOnce
[src]

type Token = I::Token

type Range = I::Range

type Position = I::Position

type Error = I::Error

impl<'a> StreamOnce for &'a str[src]

type Token = char

type Range = &'a str

type Position = PointerOffset<str>

type Error = StringStreamError

impl<'a, T> StreamOnce for &'a [T] where
    T: Clone + PartialEq
[src]

type Token = T

type Range = &'a [T]

type Position = PointerOffset<[T]>

type Error = UnexpectedParse

Loading content...

Implementors

impl<'a, T> StreamOnce for SliceStream<'a, T> where
    T: PartialEq + 'a, 
[src]

type Token = &'a T

type Range = &'a [T]

type Position = PointerOffset<[T]>

type Error = UnexpectedParse

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.

type Token = Input::Token

type Range = Input::Range

type Position = Input::Position

type Error = Input::Error

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]

type Token = Input::Token

type Range = Input::Range

type Position = X::Position

type Error = Input::Error

impl<Input: Iterator> StreamOnce for IteratorStream<Input> where
    Input::Item: Clone + PartialEq
[src]

type Token = Input::Item

type Range = Input::Item

type Position = ()

type Error = UnexpectedParse

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

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.

type Token = S::Token

type Range = S::Range

type Position = S::Position

type Error = ParseError<S>

impl<S> StreamOnce for CompleteStream<S> where
    S: StreamOnce
[src]

type Token = S::Token

type Range = S::Range

type Position = S::Position

type Error = S::Error

impl<S> StreamOnce for MaybePartialStream<S> where
    S: StreamOnce
[src]

type Token = S::Token

type Range = S::Range

type Position = S::Position

type Error = S::Error

impl<S> StreamOnce for PartialStream<S> where
    S: StreamOnce
[src]

type Token = S::Token

type Range = S::Range

type Position = S::Position

type Error = S::Error

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]

type Token = S::Token

type Range = S::Range

type Position = Span<S::Position>

type Error = E

impl<S, U> StreamOnce for combine::stream::state::Stream<S, U> where
    S: StreamOnce
[src]

type Token = S::Token

type Range = S::Range

type Position = S::Position

type Error = S::Error

Loading content...