pub struct Matcher { /* private fields */ }Expand description
The automaton a rule set compiles into.
Implementations§
Source§impl Matcher
impl Matcher
Sourcepub fn build(path: &str, rules: &[Rule]) -> Result<Matcher, Vec<Error>>
pub fn build(path: &str, rules: &[Rule]) -> Result<Matcher, Vec<Error>>
Compile a rule set.
§Errors
A rule whose pattern is one an earlier rule already has can never fire, and that is reported rather than silently dropped. It is always a mistake: either the second rule was meant to say something else, or one of the two should not be there.
Sourcepub fn find<'t>(&self, term: &'t Term) -> Option<Match<'t>>
pub fn find<'t>(&self, term: &'t Term) -> Option<Match<'t>>
Match one term against the whole rule set, returning the rule that fires.
The term is matched as a whole. Finding the subterms of a function worth matching is the selector’s job and not this one’s.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
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