Struct parser_combinators::State
[−]
[src]
pub struct State<I> where
I: Stream, { pub position: <I::Item as Positioner>::Position, pub input: I, }
The State<I>
struct keeps track of the current position in the stream I
Fields
position: <I::Item as Positioner>::Position
input: I
Methods
impl<I: Stream> State<I>
[src]
fn new(input: I) -> State<I>
fn as_empty(&self) -> State<I>
fn uncons(self) -> ParseResult<I::Item, I, 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
fn update(self, i: I::Item, rest: I) -> ParseResult<I::Item, I, I::Item>
Trait Implementations
impl<I: Clone> Clone for State<I> where
I: Stream,
I::Item: Clone,
[src]
I: Stream,
I::Item: Clone,
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
impl<I: PartialEq> PartialEq for State<I> where
I: Stream,
I::Item: PartialEq,
[src]
I: Stream,
I::Item: PartialEq,
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> Debug for State<I> where
I: Stream + Debug,
<I::Item as Positioner>::Position: Debug,
[src]
I: Stream + Debug,
<I::Item as Positioner>::Position: Debug,