The type which is taken as input for the parser. The type must implement the Stream
trait which allows the parser to read items from the type. Read more
The type which is returned if the parser is successful.
Determines the state necessary to resume parsing after more input is supplied. Read more
Parses using the stream input
and allows itself to be resumed at a later point using parse_partial
by storing the necessary intermediate state in state
Read more
Parses using the stream input
and allows itself to be resumed at a later point using parse_partial
by storing the necessary intermediate state in state
. Read more
Adds the first error that would normally be returned by this parser if it failed with an EmptyErr
result. Read more
fn easy_parse<I>( &mut self, input: I ) -> Result<(Self::Output, I), ParseError<I>> where I: Stream, Stream<I>: StreamOnce<Item = I::Item, Range = I::Range, Error = ParseError<Stream<I>>, Position = I::Position>, I::Position: Default, Self: Sized + Parser<Input = Stream<I>>, | [src] |
Entry point of the parser. Takes some input and tries to parse it, returning an easy to use and format error if parsing did not succeed. Read more
Entry point of the parser. Takes some input and tries to parse it. Read more
Entry point of the parser when using partial parsing. Takes some input and tries to parse it. Read more
Parses using the stream input
by calling [Stream::uncons
] one or more times. Read more
Parses using the stream input
by calling [Stream::uncons
] one or more times. Read more
Parses using the stream input
by calling [Stream::uncons
] one or more times. Read more
Borrows a parser instead of consuming it. Read more
Discards the value of the self
parser and returns the value of p
. Fails if any of the parsers fails. Read more
Discards the value of the p
parser and returns the value of self
. Fails if any of the parsers fails. Read more
Parses with self
followed by p
. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more
Returns a parser which attempts to parse using self
. If self
fails without consuming any input it tries to consume the same input using p
. Read more
Parses using self
and then passes the value to f
which returns a parser used to parse the rest of the input. Read more
Variant of then
which parses using self
and then passes the value to f
as a &mut
reference. Read more
Uses f
to map over the parsed value. Read more
Uses f
to map over the output of self
. If f
returns an error the parser fails. Read more
Parses with self
and if it fails, adds the message msg
to the error. Read more
Parses with self
and if it fails without consuming any input any expected errors are replaced by msg
. msg
is then used in error messages as "Expected msg
". Read more
Parses with self
, if it fails without consuming any input any expected errors that would otherwise be emitted by self
are suppressed. Read more
fn and_then<F, O, E, I>(self, f: F) -> AndThen<Self, F> where Self: Parser<Input = I> + Sized, F: FnMut(Self::Output) -> Result<O, E>, I: Stream, E: Into<<I::Error as ParseError<I::Item, I::Range, I::Position>>::StreamError>, | [src] |
Parses with self
and applies f
on the result if self
parses successfully. f
may optionally fail with an error which is automatically converted to a ParseError
. Read more
Important traits for Iter<'a, P, S, M>
impl<'a, P: Parser, S, M> Iterator for Iter<'a, P, S, M> where
S: BorrowMut<P::PartialState>,
M: ParseMode, type Item = P::Output;
Creates an iterator from a parser and a state. Can be used as an alternative to [many
] when collecting directly into a Extend
type is not desirable. Read more
Important traits for Iter<'a, P, S, M>
impl<'a, P: Parser, S, M> Iterator for Iter<'a, P, S, M> where
S: BorrowMut<P::PartialState>,
M: ParseMode, type Item = P::Output;
fn partial_iter<'a, 's, M>( self, mode: M, input: &'a mut Self::Input, partial_state: &'s mut Self::PartialState ) -> Iter<'a, Self, &'s mut Self::PartialState, M> where Self: Parser + Sized, M: ParseMode, | [src] |
Creates an iterator from a parser and a state. Can be used as an alternative to [many
] when collecting directly into a Extend
type is not desirable. Read more
Turns the parser into a trait object by putting it in a Box
. Can be used to easily return parsers from functions without naming the type. Read more
Important traits for Either<L, R>
impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;impl<L, R> Write for Either<L, R> where
L: Write,
R: Write,
Wraps the parser into the Either
enum which allows combinators such as then
to return multiple different parser types (merging them to one) Read more
Important traits for Either<L, R>
impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;impl<L, R> Write for Either<L, R> where
L: Write,
R: Write,
Wraps the parser into the Either
enum which allows combinators such as then
to return multiple different parser types (merging them to one) Read more