pub enum ENodeOrVar<L> {
ENode(L),
Var(Var),
}
Expand description
The language of Pattern
s.
Variants§
Trait Implementations§
Source§impl<L: Clone> Clone for ENodeOrVar<L>
impl<L: Clone> Clone for ENodeOrVar<L>
Source§fn clone(&self) -> ENodeOrVar<L>
fn clone(&self) -> ENodeOrVar<L>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<L: Debug> Debug for ENodeOrVar<L>
impl<L: Debug> Debug for ENodeOrVar<L>
Source§impl<L: FromOp> FromOp for ENodeOrVar<L>
impl<L: FromOp> FromOp for ENodeOrVar<L>
Source§impl<L: Hash> Hash for ENodeOrVar<L>
impl<L: Hash> Hash for ENodeOrVar<L>
Source§impl<L: Language> Language for ENodeOrVar<L>
impl<L: Language> Language for ENodeOrVar<L>
Source§type Discriminant = ENodeOrVarDiscriminant<L>
type Discriminant = ENodeOrVarDiscriminant<L>
Type representing the cases of this language. Read more
Source§fn discriminant(&self) -> Self::Discriminant
fn discriminant(&self) -> Self::Discriminant
Return the
Discriminant
of this node.Source§fn matches(&self, _other: &Self) -> bool
fn matches(&self, _other: &Self) -> bool
Returns true if this enode matches another enode.
This should only consider the operator and the arity,
not the children
Id
s.Source§fn children_mut(&mut self) -> &mut [Id]
fn children_mut(&mut self) -> &mut [Id]
Returns a mutable slice of the children of this e-node.
Source§fn for_each_mut<F: FnMut(&mut Id)>(&mut self, f: F)
fn for_each_mut<F: FnMut(&mut Id)>(&mut self, f: F)
Runs a given function on each child
Id
, allowing mutation of that Id
.Source§fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
Runs a falliable function on each child, stopping if the function returns
an error.
Source§fn update_children<F: FnMut(Id) -> Id>(&mut self, f: F)
fn update_children<F: FnMut(Id) -> Id>(&mut self, f: F)
Runs a given function to replace the children.
Source§fn map_children<F: FnMut(Id) -> Id>(self, f: F) -> Self
fn map_children<F: FnMut(Id) -> Id>(self, f: F) -> Self
Creates a new enode with children determined by the given function.
Source§fn fold<F, T>(&self, init: T, f: F) -> T
fn fold<F, T>(&self, init: T, f: F) -> T
Folds over the children, given an initial accumulator.
Source§fn all<F: FnMut(Id) -> bool>(&self, f: F) -> bool
fn all<F: FnMut(Id) -> bool>(&self, f: F) -> bool
Returns true if the predicate is true on all children.
Does not short circuit.
Source§fn any<F: FnMut(Id) -> bool>(&self, f: F) -> bool
fn any<F: FnMut(Id) -> bool>(&self, f: F) -> bool
Returns true if the predicate is true on any children.
Does not short circuit.
Source§fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
Source§fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
Source§fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
Same as
Language::build_recexpr
, but fallible.Source§impl<L: Ord> Ord for ENodeOrVar<L>
impl<L: Ord> Ord for ENodeOrVar<L>
Source§fn cmp(&self, other: &ENodeOrVar<L>) -> Ordering
fn cmp(&self, other: &ENodeOrVar<L>) -> Ordering
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 for ENodeOrVar<L>
impl<L: PartialEq> PartialEq for ENodeOrVar<L>
Source§impl<L: PartialOrd> PartialOrd for ENodeOrVar<L>
impl<L: PartialOrd> PartialOrd for ENodeOrVar<L>
impl<L: Eq> Eq for ENodeOrVar<L>
impl<L> StructuralPartialEq for ENodeOrVar<L>
Auto Trait Implementations§
impl<L> Freeze for ENodeOrVar<L>where
L: Freeze,
impl<L> RefUnwindSafe for ENodeOrVar<L>where
L: RefUnwindSafe,
impl<L> Send for ENodeOrVar<L>where
L: Send,
impl<L> Sync for ENodeOrVar<L>where
L: Sync,
impl<L> Unpin for ENodeOrVar<L>where
L: Unpin,
impl<L> UnwindSafe for ENodeOrVar<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.