Struct nom8::combinator::And
source · pub struct And<F, G> { /* private fields */ }
Expand description
Implementation of Parser::and
Trait Implementations§
source§impl<'a, I, O1, O2, E, F: Parser<I, O1, E>, G: Parser<I, O2, E>> Parser<I, (O1, O2), E> for And<F, G>
impl<'a, I, O1, O2, E, F: Parser<I, O1, E>, G: Parser<I, O2, E>> Parser<I, (O1, O2), E> for And<F, G>
source§fn parse(&mut self, i: I) -> IResult<I, (O1, O2), E>
fn parse(&mut self, i: I) -> IResult<I, (O1, O2), E>
A parser takes in input type, and returns a
Result
containing
either the remaining input and the output value, or an errorsource§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,
Returns the provided value if the child parser succeeds. Read more
source§fn output_into<O2: From<O>>(self) -> OutputInto<Self, O, O2>where
Self: Sized,
fn output_into<O2: From<O>>(self) -> OutputInto<Self, O, O2>where Self: Sized,
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,
If the child parser was successful, return 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,
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 result 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 result of a parser. Read moresource§fn map_opt<G, O2>(self, g: G) -> MapOpt<Self, G, O>where
Self: Sized,
G: FnMut(O) -> Option<O2>,
fn map_opt<G, O2>(self, g: G) -> MapOpt<Self, G, O>where Self: Sized, G: FnMut(O) -> Option<O2>,
Applies a function returning an
Option
over the result of a parser. Read moresource§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 second parser from the output of the first one, then apply over the rest of the input Read more
source§fn and_then<G, O2>(self, g: G) -> AndThen<Self, G, O>where
G: Parser<O, O2, E>,
Self: Sized,
fn and_then<G, O2>(self, g: G) -> AndThen<Self, G, O>where G: Parser<O, O2, E>, Self: Sized,
Applies a second parser over the output of the first one Read more
source§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 result 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,
E: ContextError<I, C>,
fn context<C>(self, context: C) -> Context<Self, O, C>where Self: Sized, C: Clone, E: ContextError<I, C>,
If parsing fails, add context to the error Read more
source§fn err_into<E2: From<E>>(self) -> ErrInto<Self, E, E2>where
Self: Sized,
fn err_into<E2: From<E>>(self) -> ErrInto<Self, E, E2>where Self: Sized,
Convert the parser’s error to another type using
std::convert::From
source§fn dbg_err<C>(self, context: C) -> DbgErr<Self, O, C>where
C: Display,
Self: Sized,
fn dbg_err<C>(self, context: C) -> DbgErr<Self, O, C>where C: Display, Self: Sized,
Prints a message and the input if the parser fails. Read more
Auto Trait Implementations§
impl<F, G> RefUnwindSafe for And<F, G>where F: RefUnwindSafe, G: RefUnwindSafe,
impl<F, G> Send for And<F, G>where F: Send, G: Send,
impl<F, G> Sync for And<F, G>where F: Sync, G: Sync,
impl<F, G> Unpin for And<F, G>where F: Unpin, G: Unpin,
impl<F, G> UnwindSafe for And<F, G>where F: UnwindSafe, G: UnwindSafe,
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