pub struct MapErr<T, P, F, E>{ /* private fields */ }Expand description
The parser for Parse::map_err, see method for documentation.
Trait Implementations§
Source§impl<T, P, F, E> Parse<T> for MapErr<T, P, F, E>
impl<T, P, F, E> Parse<T> for MapErr<T, P, F, E>
type Err = E
type Output = <P as Parse<T>>::Output
Source§fn parse(self, input: T) -> Result<(T, Self::Output), Self::Err>
fn parse(self, input: T) -> Result<(T, Self::Output), Self::Err>
Try to parse part of a slice, returning a tuple of the remainder (the
unparsed slice) and the output value.
Source§fn map<F, O>(self, func: F) -> Map<T, Self, F, O>
fn map<F, O>(self, func: F) -> Map<T, Self, F, O>
Maps the output of a parser with a function to produce a new output. Read more
Source§fn map_err<F, E>(self, func: F) -> MapErr<T, Self, F, E>
fn map_err<F, E>(self, func: F) -> MapErr<T, Self, F, E>
Maps the error of a parser with a function to produce a new error.
Source§fn maybe(self) -> Maybe<T, Self>
fn maybe(self) -> Maybe<T, Self>
Executes the parser if possible, wrapping up the output in an Option. Read more
Source§fn chain<I>(self, inner: I) -> Chain<T, Self, I>
fn chain<I>(self, inner: I) -> Chain<T, Self, I>
Parses the output of this parser with an inner parser, and passes the
output through.
Source§fn or<O>(self, other: O) -> Or<T, Self, O>
fn or<O>(self, other: O) -> Or<T, Self, O>
Takes the union of both combinators, accepting input which passes either
parser. Both parsers must output the same type. Read more
Source§fn and<O>(self, length_err: Self::Err, other: O) -> And<T, Self, O>
fn and<O>(self, length_err: Self::Err, other: O) -> And<T, Self, O>
Takes the conjunction of both combinators, accepting input which passes
both parsers. The remainders of both combinators must be equal, otherwise
the specified length error is yielded. Read more
Source§fn fuse<O>(self, other: O) -> Fuse<T, Self, O>
fn fuse<O>(self, other: O) -> Fuse<T, Self, O>
Accepts input which passes this parser first and then
other, packing the
output as a tuple. The remainder of the input is passed to other. Read moreSource§fn fuse_extend<O>(self, other: O) -> FuseExtend<T, Self, Self::Output, O>
fn fuse_extend<O>(self, other: O) -> FuseExtend<T, Self, Self::Output, O>
Accepts input which passes this parser first and then
other, extending
this output with other’s output. The remainder of the input is passed
to other. Read moreSource§fn repeat_const<const N: usize>(self) -> RepeatConst<T, Self, N>
fn repeat_const<const N: usize>(self) -> RepeatConst<T, Self, N>
Accepts exactly a constant amount of repetitions of this parser, packing
the output as a constant array. Read more
Source§fn repeat_greedy<O>(self, default: O) -> RepeatGreedy<T, Self, O>
fn repeat_greedy<O>(self, default: O) -> RepeatGreedy<T, Self, O>
Accepts any amount of repetitions of this parser, extending the output
into the given collection. Read more
impl<T: Eq, P, F, E: Eq> Eq for MapErr<T, P, F, E>
impl<T, P, F, E> StructuralPartialEq for MapErr<T, P, F, E>
Auto Trait Implementations§
impl<T, P, F, E> Freeze for MapErr<T, P, F, E>
impl<T, P, F, E> RefUnwindSafe for MapErr<T, P, F, E>
impl<T, P, F, E> Send for MapErr<T, P, F, E>
impl<T, P, F, E> Sync for MapErr<T, P, F, E>
impl<T, P, F, E> Unpin for MapErr<T, P, F, E>
impl<T, P, F, E> UnwindSafe for MapErr<T, P, F, E>
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