pub struct Recognize<F, O> { /* private fields */ }Expand description
Implementation of Parser::recognize
Trait Implementations§
Source§impl<I, O, E, F> Parser<I, <I as IntoOutput>::Output, E> for Recognize<F, O>
 
impl<I, O, E, F> Parser<I, <I as IntoOutput>::Output, E> for Recognize<F, O>
Source§fn parse(&mut self, input: I) -> IResult<I, <I as IntoOutput>::Output, E>
 
fn parse(&mut self, input: I) -> IResult<I, <I as IntoOutput>::Output, 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>
 
fn value<O2>(self, val: O2) -> Value<Self, O, O2>
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 span(self) -> Span<Self, O>
 
fn span(self) -> Span<Self, O>
If the child parser was successful, return the location of the consumed input as produced value. Read more
Source§fn with_span(self) -> WithSpan<Self, O>
 
fn with_span(self) -> WithSpan<Self, O>
if the child parser was successful, return the location of consumed input with the output
as a tuple. Functions similarly to Parser::span except it
returns the parser output as well. Read more
Source§fn map<G, O2>(self, g: G) -> Map<Self, G, O>
 
fn map<G, O2>(self, g: G) -> Map<Self, G, O>
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>
 
fn map_res<G, O2, E2>(self, g: G) -> MapRes<Self, G, O>
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>
 
fn map_opt<G, O2>(self, g: G) -> MapOpt<Self, G, O>
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>
 
fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>
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>
 
fn and_then<G, O2>(self, g: G) -> AndThen<Self, G, O>
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>
 
fn verify<G, O2: ?Sized>(self, second: G) -> Verify<Self, G, O2>
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>
 
fn context<C>(self, context: C) -> Context<Self, O, 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::FromSource§fn dbg_err<C>(self, context: C) -> DbgErr<Self, O, C>
 
fn dbg_err<C>(self, context: C) -> DbgErr<Self, O, C>
Available on crate feature 
std only.Prints a message and the input if the parser fails. Read more
Auto Trait Implementations§
impl<F, O> Freeze for Recognize<F, O>where
    F: Freeze,
impl<F, O> RefUnwindSafe for Recognize<F, O>where
    F: RefUnwindSafe,
    O: RefUnwindSafe,
impl<F, O> Send for Recognize<F, O>
impl<F, O> Sync for Recognize<F, O>
impl<F, O> Unpin for Recognize<F, O>
impl<F, O> UnwindSafe for Recognize<F, O>where
    F: UnwindSafe,
    O: 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