Struct winnow::combinator::FlatMap
source · pub struct FlatMap<F, G, O1> { /* private fields */ }
Expand description
Implementation of Parser::flat_map
Trait Implementations§
source§impl<I, O1, O2, E, F: Parser<I, O1, E>, G: Fn(O1) -> H, H: Parser<I, O2, E>> Parser<I, O2, E> for FlatMap<F, G, O1>
impl<I, O1, O2, E, F: Parser<I, O1, E>, G: Fn(O1) -> H, H: Parser<I, O2, E>> Parser<I, O2, E> for FlatMap<F, G, O1>
source§fn parse_next(&mut self, i: I) -> IResult<I, O2, E>
fn parse_next(&mut self, i: I) -> IResult<I, O2, E>
source§fn by_ref(&mut self) -> ByRef<'_, Self>where
Self: Sized,
fn by_ref(&mut self) -> ByRef<'_, Self>where Self: Sized,
Treat
&mut Self
as a parser Read moresource§fn value<O2>(self, val: O2) -> Value<Self, O, O2>where
Self: Sized,
O2: Clone,
fn value<O2>(self, val: O2) -> Value<Self, O, O2>where Self: Sized, O2: Clone,
Produce the provided value Read more
source§fn output_into<O2>(self) -> OutputInto<Self, O, O2>where
Self: Sized,
O: Into<O2>,
fn output_into<O2>(self) -> OutputInto<Self, O, O2>where Self: Sized, O: Into<O2>,
Convert the parser’s output to another type using
std::convert::From
Read moresource§fn recognize(self) -> Recognize<Self, O>where
Self: Sized,
fn recognize(self) -> Recognize<Self, O>where Self: Sized,
Produce the consumed input as produced value. Read more
source§fn with_recognized(self) -> WithRecognized<Self, O>where
Self: Sized,
fn with_recognized(self) -> WithRecognized<Self, O>where Self: Sized,
Produce the consumed input with the output Read more
source§fn map<G, O2>(self, g: G) -> Map<Self, G, O>where
G: Fn(O) -> O2,
Self: Sized,
fn map<G, O2>(self, g: G) -> Map<Self, G, O>where G: Fn(O) -> O2, Self: Sized,
Maps a function over the output of a parser Read more
source§fn map_res<G, O2, E2>(self, g: G) -> MapRes<Self, G, O>where
Self: Sized,
G: FnMut(O) -> Result<O2, E2>,
fn map_res<G, O2, E2>(self, g: G) -> MapRes<Self, G, O>where Self: Sized, G: FnMut(O) -> Result<O2, E2>,
Applies a function returning a
Result
over the output of a parser. Read moresource§fn verify_map<G, O2>(self, g: G) -> VerifyMap<Self, G, O>where
Self: Sized,
G: FnMut(O) -> Option<O2>,
fn verify_map<G, O2>(self, g: G) -> VerifyMap<Self, G, O>where Self: Sized, G: FnMut(O) -> Option<O2>,
source§fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>where
G: FnMut(O) -> H,
H: Parser<I, O2, E>,
Self: Sized,
fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>where G: FnMut(O) -> H, H: Parser<I, O2, E>, Self: Sized,
Creates a parser from the output of this one Read more
source§fn parse_to<O2>(self) -> ParseTo<Self, O, O2>where
Self: Sized,
O: ParseSlice<O2>,
fn parse_to<O2>(self) -> ParseTo<Self, O, O2>where Self: Sized, O: ParseSlice<O2>,
Apply
std::str::FromStr
to the output of the parser Read moresource§fn verify<G, O2: ?Sized>(self, second: G) -> Verify<Self, G, O2>where
Self: Sized,
G: Fn(&O2) -> bool,
fn verify<G, O2: ?Sized>(self, second: G) -> Verify<Self, G, O2>where Self: Sized, G: Fn(&O2) -> bool,
Returns the output of the child parser if it satisfies a verification function. Read more
source§fn context<C>(self, context: C) -> Context<Self, O, C>where
Self: Sized,
C: Clone + Debug,
E: ContextError<I, C>,
fn context<C>(self, context: C) -> Context<Self, O, C>where Self: Sized, C: Clone + Debug, E: ContextError<I, C>,
If parsing fails, add context to the error Read more