Trait pest::Parser [] [src]

pub trait Parser {
    fn matches(&mut self, string: &str) -> bool;
    fn try(&mut self, rule: Box<Fn(&mut Self) -> bool>) -> bool where Self: Sized;
    fn end(&mut self) -> bool;
    fn reset(&mut self);
}

A trait that defines a parser.

Required Methods

fn matches(&mut self, string: &str) -> bool

Matches string, returns whether it matched, and advances the parser with string.len() in case it did.

fn try(&mut self, rule: Box<Fn(&mut Self) -> bool>) -> bool where Self: Sized

Tries to match rule, returns whether it matched, and advances the parser with in case it did.

fn end(&mut self) -> bool

Returns whether a Parser has reached it end.

fn reset(&mut self)

Reset a Parser.

Implementors