Trait RewriteRule

Source
pub trait RewriteRule {
    // Required method
    fn rewrite(&self, node: NormalizedSelection) -> NormalizedSelection;
}
Expand description

A trait representing a single bottom-up rewrite rule on normalized selections.

Implementors define a transformation step applied after children have been rewritten. These rules are composed into normalization passes (see [normalize]) to simplify or canonicalize selection expressions.

This trait forms the basis for extensible normalization. Future systems may support top-down or contextual rewrites as well.

Required Methods§

Source

fn rewrite(&self, node: NormalizedSelection) -> NormalizedSelection

Applies a rewrite step to a node whose children have already been recursively rewritten.

Implementations on Foreign Types§

Source§

impl<R1, R2> RewriteRule for (R1, R2)
where R1: RewriteRule, R2: RewriteRule,

Implementors§