pub struct ParserMap<P, I: ?Sized, M, E, F> {
pub parser: P,
pub func: F,
pub phantom_i: PhantomData<I>,
pub phantom_e: PhantomData<E>,
pub phantom_m: PhantomData<M>,
}Fields§
§parser: P§func: F§phantom_i: PhantomData<I>§phantom_e: PhantomData<E>§phantom_m: PhantomData<M>Trait Implementations§
Source§impl<'a, P, M, I, O, E: ParserError, PType, F> Parser<'a, I, O, E, ParserMapT<PType, M>> for ParserMap<P, I, M, E, F>
impl<'a, P, M, I, O, E: ParserError, PType, F> Parser<'a, I, O, E, ParserMapT<PType, M>> for ParserMap<P, I, M, E, F>
Source§fn fab(&self, input: &mut &'a I) -> Result<O, E>
fn fab(&self, input: &mut &'a I) -> Result<O, E>
Parses the input. This method advances the input reference to the remaining
unparsed input. The method is named “fab” instead of “parse” to avoid conflicts
with the “parse” method of &str.
Source§fn fab_value<V: Clone>(self, value: V) -> Value<Self, V, I, O, E>where
Self: Sized,
fn fab_value<V: Clone>(self, value: V) -> Value<Self, V, I, O, E>where
Self: Sized,
Returns a parser that replaces the output of the underlying parser with V.
Source§fn fab_map<F>(self, func: F) -> ParserMap<Self, I, O, E, F>where
Self: Sized,
fn fab_map<F>(self, func: F) -> ParserMap<Self, I, O, E, F>where
Self: Sized,
This creates a Map parser that applies the function to the
output of the underlying parser.
Source§fn fab_try_map<F>(self, func: F) -> ParserTryMap<Self, I, O, E, F>where
Self: Sized,
fn fab_try_map<F>(self, func: F) -> ParserTryMap<Self, I, O, E, F>where
Self: Sized,
This parser first maps the input, and if the result is Option::Some or Result::Ok,
it unwraps the input. Othewise, the parser fails.
Auto Trait Implementations§
impl<P, I, M, E, F> Freeze for ParserMap<P, I, M, E, F>
impl<P, I, M, E, F> RefUnwindSafe for ParserMap<P, I, M, E, F>where
P: RefUnwindSafe,
F: RefUnwindSafe,
I: RefUnwindSafe + ?Sized,
E: RefUnwindSafe,
M: RefUnwindSafe,
impl<P, I, M, E, F> Send for ParserMap<P, I, M, E, F>
impl<P, I, M, E, F> Sync for ParserMap<P, I, M, E, F>
impl<P, I, M, E, F> Unpin for ParserMap<P, I, M, E, F>
impl<P, I, M, E, F> UnwindSafe for ParserMap<P, I, M, E, F>
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