Struct combine::primitives::State
[−]
[src]
pub struct State<I> where I: Stream {
pub position: I::Item::Position,
pub input: I,
}The State<I> struct keeps track of the current position in the stream I
Fields
position: I::Item::Position
The current position
input: I
The input stream used when items are requested
Methods
impl<I: Stream> State<I>[src]
fn new(input: I) -> State<I>
Creates a new State<I> from an input stream. Initializes the position to
Positioner::start()
fn uncons(self) -> ParseResult<I::Item, I>
uncons is the most general way of extracting and item from a stream
It takes a function f as argument which should update the position
according to the item that was extracted
Usually you want to use uncons_char instead which works directly on character streams
fn update(self, item: I::Item, rest: I) -> ParseResult<I::Item, I>
Updates the position and input to be as if item was removed and rest is
the remaining input
Trait Implementations
impl<I: PartialEq> PartialEq for State<I> where I: Stream, I::Item: PartialEq[src]
fn eq(&self, __arg_0: &State<I>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &State<I>) -> bool
This method tests for !=.
impl<I: Clone> Clone for State<I> where I: Stream, I::Item: Clone[src]
fn clone(&self) -> State<I>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more