Struct moniker::Rec [−][src]
pub struct Rec<P> { pub unsafe_pattern: P, }
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
Methods
impl<P> Rec<P>
[src]
impl<P> Rec<P>
pub fn new<N>(pattern: P) -> Rec<P> where
N: Clone,
P: BoundPattern<N>,
[src]
pub fn new<N>(pattern: P) -> Rec<P> where
N: Clone,
P: BoundPattern<N>,
pub fn unrec<N>(self) -> P where
N: Clone,
P: BoundPattern<N>,
[src]
pub fn unrec<N>(self) -> P where
N: Clone,
P: BoundPattern<N>,
Trait Implementations
impl<P: Debug> Debug for Rec<P>
[src]
impl<P: Debug> Debug for Rec<P>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<P: Clone> Clone for Rec<P>
[src]
impl<P: Clone> Clone for Rec<P>
fn clone(&self) -> Rec<P>
[src]
fn clone(&self) -> Rec<P>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<P: PartialEq> PartialEq for Rec<P>
[src]
impl<P: PartialEq> PartialEq for Rec<P>
fn eq(&self, other: &Rec<P>) -> bool
[src]
fn eq(&self, other: &Rec<P>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rec<P>) -> bool
[src]
fn ne(&self, other: &Rec<P>) -> bool
This method tests for !=
.
impl<P: Eq> Eq for Rec<P>
[src]
impl<P: Eq> Eq for Rec<P>
impl<N, P> BoundPattern<N> for Rec<P> where
P: BoundPattern<N>,
[src]
impl<N, P> BoundPattern<N> for Rec<P> where
P: BoundPattern<N>,
fn pattern_eq(&self, other: &Rec<P>) -> bool
[src]
fn pattern_eq(&self, other: &Rec<P>) -> bool
Alpha equivalence in a pattern context
fn close_pattern(&mut self, state: ScopeState, binders: &[Binder<N>])
[src]
fn close_pattern(&mut self, state: ScopeState, binders: &[Binder<N>])
fn open_pattern(&mut self, state: ScopeState, binders: &[Binder<N>])
[src]
fn open_pattern(&mut self, state: ScopeState, binders: &[Binder<N>])
fn visit_binders(
&self,
on_binder: &mut impl FnMut(&Binder<N>)
)
[src]
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>)
)
[src]
fn visit_mut_binders(
&mut self,
on_binder: &mut impl FnMut(&mut Binder<N>)
)
fn binders(&self) -> Vec<Binder<N>> where
N: Clone,
[src]
fn binders(&self) -> Vec<Binder<N>> where
N: Clone,
Returns the binders in this pattern