combine

Trait StreamOnce

source
pub trait StreamOnce {
    type Token: Clone;
    type Range: Clone;
    type Position: Clone + Ord;
    type Error: ParseError<Self::Token, Self::Range, Self::Position>;

    // Required method
    fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>;

    // Provided method
    fn is_partial(&self) -> bool { ... }
}
Expand description

StreamOnce represents a sequence of items that can be extracted one by one.

Required Associated Types§

source

type Token: Clone

The type of items which is yielded from this stream.

source

type Range: Clone

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.

source

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.

source

type Error: ParseError<Self::Token, Self::Range, Self::Position>

Required Methods§

source

fn uncons(&mut self) -> Result<Self::Token, StreamErrorFor<Self>>

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§

source

fn is_partial(&self) -> bool

Returns true if this stream only contains partial input.

See PartialStream.

Implementations on Foreign Types§

source§

impl<'a> StreamOnce for &'a str

source§

impl<'a, I> StreamOnce for &'a mut I
where I: StreamOnce + ?Sized,

source§

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

Implementors§

source§

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

source§

impl<Input> StreamOnce for combine::stream::buffered::Stream<Input>
where Input: StreamOnce + Positioned, Input::Token: Clone,

source§

type Token = <Input as StreamOnce>::Token

source§

type Range = <Input as StreamOnce>::Range

source§

type Position = <Input as StreamOnce>::Position

source§

type Error = <Input as StreamOnce>::Error

source§

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>,

source§

type Token = <Input as StreamOnce>::Token

source§

type Range = <Input as StreamOnce>::Range

source§

type Position = <X as Positioner<<Input as StreamOnce>::Token>>::Position

source§

type Error = <Input as StreamOnce>::Error

source§

impl<Input: Iterator> StreamOnce for IteratorStream<Input>
where Input::Item: Clone + PartialEq,

source§

impl<R: Read> StreamOnce for combine::stream::read::Stream<R>

source§

impl<S> StreamOnce for combine::stream::easy::Stream<S>

source§

impl<S> StreamOnce for CompleteStream<S>
where S: StreamOnce,

source§

impl<S> StreamOnce for MaybePartialStream<S>
where S: StreamOnce,

source§

impl<S> StreamOnce for PartialStream<S>
where S: StreamOnce,

source§

impl<S, E> StreamOnce for combine::stream::span::Stream<S, E>

source§

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