pub enum RefrainLang {
Note([Id; 2]),
Loop([Id; 2]),
Diff([Id; 2]),
Quotient(Box<[Id]>),
Seq(Box<[Id]>),
Num(u32),
Sym(Symbol),
}Expand description
Term sort for Refrain ASTs inside egg’s e-graph.
Variants§
Trait Implementations§
Source§impl Clone for RefrainLang
impl Clone for RefrainLang
Source§fn clone(&self) -> RefrainLang
fn clone(&self) -> RefrainLang
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefrainLang
impl Debug for RefrainLang
Source§impl Display for RefrainLang
impl Display for RefrainLang
Source§impl FromOp for RefrainLang
impl FromOp for RefrainLang
Source§impl Hash for RefrainLang
impl Hash for RefrainLang
Source§impl Language for RefrainLang
impl Language for RefrainLang
Source§type Discriminant = Discriminant<RefrainLang>
type Discriminant = Discriminant<RefrainLang>
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
Ids.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>(&mut self, f: F)
fn for_each_mut<F>(&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>(&mut self, f: F)
fn update_children<F>(&mut self, f: F)
Runs a given function to replace the children.
Source§fn map_children<F>(self, f: F) -> Self
fn map_children<F>(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>(&self, f: F) -> bool
fn all<F>(&self, f: F) -> bool
Returns true if the predicate is true on all children.
Does not short circuit.
Source§fn any<F>(&self, f: F) -> bool
fn any<F>(&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 Ord for RefrainLang
impl Ord for RefrainLang
Source§fn cmp(&self, other: &RefrainLang) -> Ordering
fn cmp(&self, other: &RefrainLang) -> Ordering
1.21.0 (const: unstable) · 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 PartialEq for RefrainLang
impl PartialEq for RefrainLang
Source§fn eq(&self, other: &RefrainLang) -> bool
fn eq(&self, other: &RefrainLang) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for RefrainLang
impl PartialOrd for RefrainLang
impl Eq for RefrainLang
impl StructuralPartialEq for RefrainLang
Auto Trait Implementations§
impl Freeze for RefrainLang
impl RefUnwindSafe for RefrainLang
impl Send for RefrainLang
impl Sync for RefrainLang
impl Unpin for RefrainLang
impl UnsafeUnpin for RefrainLang
impl UnwindSafe for RefrainLang
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.