Skip to main content

RewriteRule

Trait RewriteRule 

Source
pub trait RewriteRule: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn apply(&self, query: QueryExpr, ctx: &mut RewriteContext) -> QueryExpr;
    fn is_applicable(&self, query: &QueryExpr) -> bool;
}
Expand description

A rewrite rule that transforms query expressions

Required Methods§

Source

fn name(&self) -> &str

Rule name for debugging

Source

fn apply(&self, query: QueryExpr, ctx: &mut RewriteContext) -> QueryExpr

Apply the rule to a query expression

Source

fn is_applicable(&self, query: &QueryExpr) -> bool

Check if this rule is applicable to the query

Implementors§