pub struct Satisfy<I, P> { /* private fields */ }
Trait Implementations§
Source§impl<I, P> Parser for Satisfy<I, P>
impl<I, P> Parser for Satisfy<I, P>
Source§type Input = I
type Input = I
A type implementing the
Stream
trait which is the specific type
that is parsed.Source§fn parse_lazy(&mut self, input: State<I>) -> ParseResult<I::Item, I, I::Item>
fn parse_lazy(&mut self, input: State<I>) -> ParseResult<I::Item, I, I::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 parse(
&mut self,
input: Self::Input,
) -> Result<(Self::Output, Self::Input), ParseError<<Self::Input as Stream>::Item>>
fn parse( &mut self, input: Self::Input, ) -> Result<(Self::Output, Self::Input), ParseError<<Self::Input as Stream>::Item>>
Entrypoint of the parser
Takes some input and tries to parse it returning a
ParseResult
Auto Trait Implementations§
impl<I, P> Freeze for Satisfy<I, P>where
P: Freeze,
impl<I, P> RefUnwindSafe for Satisfy<I, P>where
P: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, P> Send for Satisfy<I, P>
impl<I, P> Sync for Satisfy<I, P>
impl<I, P> Unpin for Satisfy<I, P>
impl<I, P> UnwindSafe for Satisfy<I, P>where
P: UnwindSafe,
I: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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