Struct pidgin::Grammar [−][src]
pub struct Grammar { /* fields omitted */ }A compiled collection of rules ready for the building of a
pidgin::Matcher or for use in the definition of a new rule.
You do not build new Grammars directly. Rather, the compile or grammar
method of a Pidgin produces them for you.
Methods
impl Grammar[src]
impl Grammarpub fn matcher(&self) -> Result<Matcher, Error>[src]
pub fn matcher(&self) -> Result<Matcher, Error>Compiles a Matcher based on the Grammar's rules.
If the Grammar contains a "foreign rule" with a named capture, an
error may be returned.
pub fn to_string(&self) -> String[src]
pub fn to_string(&self) -> StringReturns a quasi-regex representation of the grammar. This is intended mostly for debugging. Rules will be identifiable by named groups, but group names may repeat, in which case the stringification cannot be compiled into a regular expression.
Trait Implementations
impl Clone for Grammar[src]
impl Clone for Grammarfn clone(&self) -> Grammar[src]
fn clone(&self) -> GrammarReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Grammar[src]
impl Debug for Grammarfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialOrd for Grammar[src]
impl PartialOrd for Grammarfn partial_cmp(&self, other: &Grammar) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Grammar) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0[src]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for Grammar[src]
impl Ord for Grammarfn cmp(&self, other: &Grammar) -> Ordering[src]
fn cmp(&self, other: &Grammar) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialEq for Grammar[src]
impl PartialEq for Grammarfn eq(&self, other: &Grammar) -> bool[src]
fn eq(&self, other: &Grammar) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for Grammar[src]
impl Eq for Grammar