Struct combine::primitives::State [] [src]

pub struct State<I> where
    I: Stream,
    I::Item: Positioner
{ pub position: <I::Item as Positioner>::Position, pub input: I, }

The State<I> struct keeps track of the current position in the stream I using the Positioner trait to update the position.

Fields

The current position

The input stream used when items are requested

Methods

impl<I> State<I> where
    I: Stream,
    I::Item: Positioner
[src]

[src]

Creates a new State<I> from an input stream. Initializes the position to Positioner::start().

Trait Implementations

impl<I: Clone> Clone for State<I> where
    I: Stream,
    I::Item: Positioner,
    I::Item: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<I: PartialEq> PartialEq for State<I> where
    I: Stream,
    I::Item: Positioner,
    I::Item: PartialEq
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<I> Debug for State<I> where
    I: Stream + Debug,
    I::Item: Positioner,
    <I::Item as Positioner>::Position: Debug
[src]

[src]

Formats the value using the given formatter.

impl<I> StreamOnce for State<I> where
    I: Stream,
    I::Item: Positioner
[src]

The type of items which is yielded from this stream.

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. Read more

Type which represents the position in a stream. Ord is required to allow parsers to determine which of two positions are further ahead. Read more

[src]

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. Read more

[src]

Returns the current position of the stream.

impl<I, E> RangeStream for State<I> where
    I: RangeStream<Item = E>,
    I::Range: Range + Positioner<Position = E::Position>,
    E: Positioner + Clone
[src]

[src]

Takes size elements from the stream. Fails if the length of the stream is less than size. Read more

[src]

Takes items from stream, testing each one with predicate. returns the range of items which passed predicate. Read more

impl<I, E> FullRangeStream for State<I> where
    I: RangeStream<Item = E>,
    I::Range: Range + Positioner<Position = E::Position>,
    E: Positioner + Clone,
    I: FullRangeStream
[src]

[src]

Returns the entire range of self