Struct egg::SymbolLang
source · [−]Expand description
A simple language used for testing.
Fields
op: Symbol
The operator for an enode
children: Vec<Id>
The enode’s children Id
s
Implementations
sourceimpl SymbolLang
impl SymbolLang
Trait Implementations
sourceimpl Clone for SymbolLang
impl Clone for SymbolLang
sourcefn clone(&self) -> SymbolLang
fn clone(&self) -> SymbolLang
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SymbolLang
impl Debug for SymbolLang
sourceimpl<'de> Deserialize<'de> for SymbolLang
impl<'de> Deserialize<'de> for SymbolLang
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for SymbolLang
impl Display for SymbolLang
sourceimpl FromOp for SymbolLang
impl FromOp for SymbolLang
sourceimpl Hash for SymbolLang
impl Hash for SymbolLang
sourceimpl Language for SymbolLang
impl Language for SymbolLang
type Discriminant = Symbol
type Discriminant = Symbol
Type representing the cases of this language. Read more
sourcefn discriminant(&self) -> Self::Discriminant
fn discriminant(&self) -> Self::Discriminant
Return the Discriminant
of this node.
sourcefn 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, not the children Id
s. Read more
sourcefn children_mut(&mut self) -> &mut [Id]
fn children_mut(&mut self) -> &mut [Id]
Returns a mutable slice of the children of this e-node.
sourcefn 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
.
sourcefn try_for_each<E, F>(&self, f: F) -> Result<(), E> where
F: FnMut(Id) -> Result<(), E>,
E: Clone,
fn try_for_each<E, F>(&self, f: F) -> Result<(), E> where
F: FnMut(Id) -> Result<(), E>,
E: Clone,
Runs a falliable function on each child, stopping if the function returns an error. Read more
sourcefn 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.
sourcefn 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.
sourcefn fold<F, T>(&self, init: T, f: F) -> T where
F: FnMut(T, Id) -> T,
T: Clone,
fn fold<F, T>(&self, init: T, f: F) -> T where
F: FnMut(T, Id) -> T,
T: Clone,
Folds over the children, given an initial accumulator.
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self> where
F: FnMut(Id) -> Expr,
Expr: AsRef<[Self]>,
fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self> where
F: FnMut(Id) -> Expr,
Expr: AsRef<[Self]>,
sourcefn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self> where
F: FnMut(Id) -> Self,
fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self> where
F: FnMut(Id) -> Self,
sourcefn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err> where
F: FnMut(Id) -> Result<Self, Err>,
fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err> where
F: FnMut(Id) -> Result<Self, Err>,
Same as Language::build_recexpr
, but fallible.
sourceimpl Ord for SymbolLang
impl Ord for SymbolLang
sourceimpl PartialEq<SymbolLang> for SymbolLang
impl PartialEq<SymbolLang> for SymbolLang
sourcefn eq(&self, other: &SymbolLang) -> bool
fn eq(&self, other: &SymbolLang) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SymbolLang) -> bool
fn ne(&self, other: &SymbolLang) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SymbolLang> for SymbolLang
impl PartialOrd<SymbolLang> for SymbolLang
sourcefn partial_cmp(&self, other: &SymbolLang) -> Option<Ordering>
fn partial_cmp(&self, other: &SymbolLang) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for SymbolLang
impl Serialize for SymbolLang
impl Eq for SymbolLang
impl StructuralEq for SymbolLang
impl StructuralPartialEq for SymbolLang
Auto Trait Implementations
impl RefUnwindSafe for SymbolLang
impl Send for SymbolLang
impl Sync for SymbolLang
impl Unpin for SymbolLang
impl UnwindSafe for SymbolLang
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more