pub struct RecExpr<L> { /* private fields */ }
Expand description
A recursive expression from a user-defined Language
.
This conceptually represents a recursive expression, but it’s actually just a list of enodes.
RecExpr
s must satisfy the invariant that enodes’ children must refer to
elements that come before it in the list.
If the serde-1
feature is enabled, this implements
serde::Serialize
.
Implementations§
source§impl<L: Language> RecExpr<ENodeOrVar<L>>
impl<L: Language> RecExpr<ENodeOrVar<L>>
sourcepub fn alpha_rename(&self) -> Self
pub fn alpha_rename(&self) -> Self
Returns a new PatternAst
with the variables renames canonically
Trait Implementations§
source§impl<L: Language> From<RecExpr<ENodeOrVar<L>>> for Pattern<L>
impl<L: Language> From<RecExpr<ENodeOrVar<L>>> for Pattern<L>
source§fn from(ast: PatternAst<L>) -> Self
fn from(ast: PatternAst<L>) -> Self
Converts to this type from the input type.
source§impl<L: Ord> Ord for RecExpr<L>
impl<L: Ord> Ord for RecExpr<L>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<L: PartialEq> PartialEq<RecExpr<L>> for RecExpr<L>
impl<L: PartialEq> PartialEq<RecExpr<L>> for RecExpr<L>
source§impl<L: PartialOrd> PartialOrd<RecExpr<L>> for RecExpr<L>
impl<L: PartialOrd> PartialOrd<RecExpr<L>> for RecExpr<L>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<L: Eq> Eq for RecExpr<L>
impl<L> StructuralEq for RecExpr<L>
impl<L> StructuralPartialEq for RecExpr<L>
Auto Trait Implementations§
impl<L> RefUnwindSafe for RecExpr<L>where L: RefUnwindSafe,
impl<L> Send for RecExpr<L>where L: Send,
impl<L> Sync for RecExpr<L>where L: Sync,
impl<L> Unpin for RecExpr<L>where L: Unpin,
impl<L> UnwindSafe for RecExpr<L>where L: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.