pub struct Unexpected<I>(/* private fields */)
where
I: Stream;
Trait Implementations§
Source§impl<I> Clone for Unexpected<I>
impl<I> Clone for Unexpected<I>
Source§fn clone(&self) -> Unexpected<I>
fn clone(&self) -> Unexpected<I>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<I> Parser for Unexpected<I>where
I: Stream,
impl<I> Parser for Unexpected<I>where
I: Stream,
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, I::Item>
fn parse_lazy(&mut self, input: State<I>) -> ParseResult<(), 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 add_error(&mut self, error: &mut ParseError<<Self::Input as Stream>::Item>)
fn add_error(&mut self, error: &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<I> Freeze for Unexpected<I>
impl<I> RefUnwindSafe for Unexpected<I>
impl<I> Send for Unexpected<I>
impl<I> Sync for Unexpected<I>
impl<I> Unpin for Unexpected<I>
impl<I> UnwindSafe for Unexpected<I>
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