pub struct RewriteRule {
pub pattern: Pattern,
pub template: fn(&HashMap<String, TLExpr>) -> TLExpr,
pub name: Option<String>,
}Expand description
A rewrite rule that transforms expressions matching a pattern into a template.
Fields§
§pattern: PatternThe pattern to match
template: fn(&HashMap<String, TLExpr>) -> TLExprFunction to generate the replacement expression from bindings
name: Option<String>Optional name for debugging
Implementations§
Trait Implementations§
Source§impl Clone for RewriteRule
impl Clone for RewriteRule
Source§fn clone(&self) -> RewriteRule
fn clone(&self) -> RewriteRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RewriteRule
impl RefUnwindSafe for RewriteRule
impl Send for RewriteRule
impl Sync for RewriteRule
impl Unpin for RewriteRule
impl UnwindSafe for RewriteRule
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