Skip to main content

PatternClosure

Type Alias PatternClosure 

Source
pub type PatternClosure<C> = Arc<dyn Fn(&Arc<UOp>, &mut C) -> RewriteResult + Send + Sync>;
Expand description

Closure type for pattern matching + rewriting.

Takes a UOp and mutable context, returns a RewriteResult. Uses Arc instead of Box to enable Clone on SimplifiedPatternMatcher, which is needed for caching combined matchers via LazyLock.

Aliased Typeยง

pub struct PatternClosure<C> { /* private fields */ }