Struct parser_combinators::primitives::State
[−]
[src]
pub struct State<I> {
pub position: SourcePosition,
pub input: I,
}The State<I> struct keeps track of the current position in the stream I
Fields
position: SourcePosition
input: I
Methods
impl<I: Stream> State<I>[src]
fn new(input: I) -> State<I>
fn as_empty(&self) -> State<I>
fn uncons<F>(self, f: F) -> ParseResult<I::Item, I> where F: FnOnce(&mut SourcePosition, &I::Item)
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
impl<I: Stream<Item=char>> State<I>[src]
fn uncons_char(self) -> ParseResult<I::Item, I>
Specialized uncons function for character streams which updates the position with no further action needed
Trait Implementations
impl<I: Debug> Debug for State<I>[src]
impl<I: PartialEq> PartialEq for State<I>[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>[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