pub struct Rec<P> {
pub unsafe_pattern: P,
}
Expand description
Recursively bind a pattern in itself
Mutually recursive bindings can be modelled by combining this type with
the pattern implementations for Vec<P>
and (P1, P2)
.
Fields
unsafe_pattern: P
Implementations
Trait Implementations
sourceimpl<N, P> BoundPattern<N> for Rec<P>where
N: Clone + PartialEq,
P: BoundPattern<N>,
impl<N, P> BoundPattern<N> for Rec<P>where
N: Clone + PartialEq,
P: BoundPattern<N>,
sourcefn pattern_eq(&self, other: &Rec<P>) -> bool
fn pattern_eq(&self, other: &Rec<P>) -> 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 Read moresourcefn 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 Read moresourcefn 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 Read moresourcefn 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 Read moreimpl<P: Eq> Eq for Rec<P>
impl<P> StructuralEq for Rec<P>
impl<P> StructuralPartialEq for Rec<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for Rec<P>where
P: RefUnwindSafe,
impl<P> Send for Rec<P>where
P: Send,
impl<P> Sync for Rec<P>where
P: Sync,
impl<P> Unpin for Rec<P>where
P: Unpin,
impl<P> UnwindSafe for Rec<P>where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more