pub trait RewriteRule: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn apply(&self, expr: &TLExpr) -> Option<TLExpr>;
// Provided method
fn is_recursive(&self) -> bool { ... }
}Expand description
A single pattern-matching rewrite rule.
Implementors inspect an expression and, if the rule matches, return a
transformed replacement expression. If the rule does not apply, None
is returned and the engine tries the next rule.
Required Methods§
Provided Methods§
Sourcefn is_recursive(&self) -> bool
fn is_recursive(&self) -> bool
Whether the engine should recurse into children of expr before
trying this rule. Defaults to true (standard bottom-up traversal).