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§
Sourcefn rewrite(&self, node: NormalizedSelection) -> NormalizedSelection
fn rewrite(&self, node: NormalizedSelection) -> NormalizedSelection
Applies a rewrite step to a node whose children have already been recursively rewritten.