pub struct AndThen<P, F>(/* private fields */);
Trait Implementations§
Source§impl<P, F, O, E> Parser for AndThen<P, F>
impl<P, F, O, E> Parser for AndThen<P, F>
Source§type Input = <P as Parser>::Input
type Input = <P as Parser>::Input
A type implementing the
Stream
trait which is the specific type
that is parsed.Source§fn parse_lazy(
&mut self,
input: State<<Self as Parser>::Input>,
) -> ParseResult<O, <Self as Parser>::Input, <Self::Input as Stream>::Item>
fn parse_lazy( &mut self, input: State<<Self as Parser>::Input>, ) -> ParseResult<O, <Self as Parser>::Input, <Self::Input as Stream>::Item>
Specialized version of parse_state where the parser does not need to add an error to the
ParseError
when it does not consume any input before encountering the error.
Instead the error can be added later through the add_error
methodSource§fn add_error(&mut self, errors: &mut ParseError<<Self::Input as Stream>::Item>)
fn add_error(&mut self, errors: &mut ParseError<<Self::Input as Stream>::Item>)
Adds the first error that would normally be returned by this parser if it failed
Auto Trait Implementations§
impl<P, F> Freeze for AndThen<P, F>
impl<P, F> RefUnwindSafe for AndThen<P, F>where
P: RefUnwindSafe,
F: RefUnwindSafe,
impl<P, F> Send for AndThen<P, F>
impl<P, F> Sync for AndThen<P, F>
impl<P, F> Unpin for AndThen<P, F>
impl<P, F> UnwindSafe for AndThen<P, F>where
P: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<P> ParserExt for Pwhere
P: Parser,
impl<P> ParserExt for Pwhere
P: Parser,
Source§fn with<P2>(self, p: P2) -> With<Self, P2>
fn with<P2>(self, p: P2) -> With<Self, P2>
Discards the value of the
self
parser and returns the value of p
Fails if any of the parsers fails Read moreSource§fn skip<P2>(self, p: P2) -> Skip<Self, P2>
fn skip<P2>(self, p: P2) -> Skip<Self, P2>
Discards the value of the
p
parser and returns the value of self
Fails if any of the parsers fails Read moreSource§fn and<P2>(self, p: P2) -> And<Self, P2>
fn and<P2>(self, p: P2) -> And<Self, P2>
Parses with
self
followed by p
Succeds if both parsers succed, otherwise fails
Returns a tuple with both values on success Read moreSource§fn then<N, F>(self, f: F) -> Then<Self, F>
fn then<N, F>(self, f: F) -> Then<Self, F>
Parses using
self
and then passes the value to f
which returns a parser used to parse
the rest of the input Read moreSource§fn expected<S>(self, msg: S) -> Expected<Self>
fn expected<S>(self, msg: S) -> Expected<Self>
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