RecognizeSelf

Trait RecognizeSelf 

Source
pub trait RecognizeSelf<'a, T, V>: MatchSize {
    // Required method
    fn recognize_self(
        self,
        scanner: &mut Scanner<'a, T>,
    ) -> ParseResult<Option<V>>;
}

Required Methods§

Source

fn recognize_self(self, scanner: &mut Scanner<'a, T>) -> ParseResult<Option<V>>

Try to recognize the object for the given scanner.

§Arguments
  • scanner - The scanner to recognize the object for.
§Returns
  • Ok(Some(V)) if the object was recognized,
  • Ok(None) if the object was not recognized,
  • Err(ParseError) if an error occurred

Implementors§

Source§

impl<'a, T, M: Match<T> + MatchSize> RecognizeSelf<'a, T, M> for M

Recognize an object for the given scanner. Return a slice of the recognized object.