pub trait ReduceRule<V: VTable, C: RewriteContext>:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn reduce(
&self,
expr: &ExpressionView<'_, V>,
ctx: &C,
) -> VortexResult<Option<Expression>>;
}Expand description
A rewrite rule that transforms expressions without needing context.
Called during bottom-up traversal after children have been processed.
This is useful for self-contained rewrites like: select(...) -> pack(get_item(...))
§Type Parameters
V- The VTable type this rule applies to. The rule will only be invoked for expressions with this vtable type, providing compile-time type safety.