pub trait BoundPattern<N: Clone + PartialEq> {
// Required methods
fn pattern_eq(&self, other: &Self) -> bool;
fn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>);
fn open_pattern(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>);
fn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>));
fn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>));
fn visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>));
fn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>));
// Provided methods
fn free_vars(&self) -> HashSet<FreeVar<N>>
where N: Eq + Hash + Clone { ... }
fn binders(&self) -> Vec<Binder<N>>
where N: Clone { ... }
}
Expand description
Patterns that bind variables in terms
Required Methods§
Sourcefn pattern_eq(&self, other: &Self) -> bool
fn pattern_eq(&self, other: &Self) -> bool
Alpha equivalence for patterns
Sourcefn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
fn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
Close the terms in the pattern using the supplied binders
Sourcefn open_pattern(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
fn open_pattern(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
Open the terms in the pattern using the supplied binders
Sourcefn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>))
fn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>))
Visit each variable in the term, calling the on_var
callback on each
of them in turn
Sourcefn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>))
fn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>))
Visit each variable in the term, calling the on_var
callback on each
of them in turn
Sourcefn visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>))
fn visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>))
Visit each of the binders in the term, calling the on_binder
callback
on each of them in turn
Sourcefn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>))
fn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>))
Visit each of the binders in the term, calling the on_binder
callback
on each of them in turn
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.