Struct som_parser_core::Map
source · pub struct Map<P, F, T> { /* private fields */ }
Expand description
Maps a function over the output value of the parser.
Trait Implementations§
source§impl<P, T, F, U, I> Parser<U, I> for Map<P, F, T>
impl<P, T, F, U, I> Parser<U, I> for Map<P, F, T>
source§fn parse<'a>(&mut self, input: I) -> Option<(U, I)>
fn parse<'a>(&mut self, input: I) -> Option<(U, I)>
Applies the parser on some input. Read more
source§fn and<U, P: Parser<U, I>>(self, parser: P) -> And<Self, P>
fn and<U, P: Parser<U, I>>(self, parser: P) -> And<Self, P>
Sequences two parsers, one after the other, collecting both results.
source§fn or<P: Parser<T, I>>(self, parser: P) -> Or<Self, P>
fn or<P: Parser<T, I>>(self, parser: P) -> Or<Self, P>
Tries to apply the first parser, if it fails, it tries to apply the second parser.
source§fn map<F: Fn(T) -> U, U>(self, func: F) -> Map<Self, F, T>
fn map<F: Fn(T) -> U, U>(self, func: F) -> Map<Self, F, T>
Maps a function over the output value of the parser.
Auto Trait Implementations§
impl<P, F, T> Freeze for Map<P, F, T>
impl<P, F, T> RefUnwindSafe for Map<P, F, T>
impl<P, F, T> Send for Map<P, F, T>
impl<P, F, T> Sync for Map<P, F, T>
impl<P, F, T> Unpin for Map<P, F, T>
impl<P, F, T> UnwindSafe for Map<P, F, T>
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