Trait rational_deduction::Expression [−][src]
Expression Trait
Associated Types
Loading content...Required methods
pub fn cases(&self) -> ExprRef<'_, Self>
[src]
Returns a reference to the underlying Expression
type.
pub fn from_atom(atom: Self::Atom) -> Self
[src]
Builds an Expression
from an atomic element.
pub fn from_group(group: Self::Group) -> Self
[src]
Builds an Expression
from a grouped expression.
Provided methods
#[must_use]pub fn from_expr(expr: Expr<Self>) -> Self
[src]
Converts from the canonical enumeration.
#[must_use]pub fn is_atom(&self) -> bool
[src]
Checks if the Expression
is atomic.
#[must_use]pub fn is_group(&self) -> bool
[src]
Checks if the Expression
is a grouped expression.
#[must_use]pub fn atom(self) -> Option<Self::Atom>
[src]
Converts from an Expression
to an Option<E::Atom>
.
#[must_use]pub fn group(self) -> Option<Self::Group>
[src]
Converts from an Expression
to an Option<E::Group>
.
pub fn unwrap_atom(self) -> Self::Atom
[src]
Returns the contained Atom
value, consuming the self
value.
Panics
Panics if the self
value is a Group
.
pub fn unwrap_group(self) -> Self::Group
[src]
Returns the contained Group
value, consuming the self
value.
Panics
Panics if the self
value is an Atom
.
pub fn default_atom<T>() -> Self::Atom where
Self::Atom: FromIterator<T>,
[src]
Self::Atom: FromIterator<T>,
Builds an empty atomic expression.
pub fn default_group() -> Self::Group where
Self::Group: FromIterator<Self>,
[src]
Self::Group: FromIterator<Self>,
Builds an empty grouped expression.
pub fn default() -> Self where
Self::Group: FromIterator<Self>,
[src]
Self::Group: FromIterator<Self>,
Returns the default value of an Expression
: the empty group.
pub fn empty_atom<T>() -> Self where
Self::Atom: FromIterator<T>,
[src]
Self::Atom: FromIterator<T>,
Builds an empty atomic expression.
pub fn empty_group() -> Self where
Self::Group: FromIterator<Self>,
[src]
Self::Group: FromIterator<Self>,
Builds an empty grouped expression.
pub fn clone(&self) -> Self where
Self::Atom: Clone,
Self::Group: FromIterator<Self>,
[src]
Self::Atom: Clone,
Self::Group: FromIterator<Self>,
Clones an Expression
that has Clone
-able Atom
s.
pub fn eq<E>(&self, other: &E) -> bool where
E: Expression,
Self::Atom: PartialEq<<E as Expression>::Atom>,
[src]
E: Expression,
Self::Atom: PartialEq<<E as Expression>::Atom>,
Checks if two Expression
s are equal using PartialEq
on their Atom
s.
pub fn is_subexpression<E>(&self, other: &E) -> bool where
E: Expression,
Self::Atom: PartialEq<<E as Expression>::Atom>,
[src]
E: Expression,
Self::Atom: PartialEq<<E as Expression>::Atom>,
Checks if an Expression
is a sub-tree of another Expression
using PartialEq
on their
Atom
s.
pub fn map<E, F>(self, f: F) -> E where
E: Expression,
F: FnMut(Self::Atom) -> <E as Expression>::Atom,
Self::Group: IntoIterator,
<E as Expression>::Group: FromIterator<E>,
<Self::Group as IntoIterator>::Item == Self,
[src]
E: Expression,
F: FnMut(Self::Atom) -> <E as Expression>::Atom,
Self::Group: IntoIterator,
<E as Expression>::Group: FromIterator<E>,
<Self::Group as IntoIterator>::Item == Self,
Extends a function on Atom
s to a function on Expression
s.
pub fn map_ref<E, F>(&self, f: F) -> E where
E: Expression,
F: FnMut(&Self::Atom) -> <E as Expression>::Atom,
<E as Expression>::Group: FromIterator<E>,
[src]
E: Expression,
F: FnMut(&Self::Atom) -> <E as Expression>::Atom,
<E as Expression>::Group: FromIterator<E>,
Extends a function on &Atom
s to a function on &Expression
s.
pub fn substitute<F>(self, f: F) -> Self where
F: FnMut(Self::Atom) -> Self,
Self::Group: FromIterator<Self>,
Self::Group: IntoIterator,
<Self::Group as IntoIterator>::Item == Self,
[src]
F: FnMut(Self::Atom) -> Self,
Self::Group: FromIterator<Self>,
Self::Group: IntoIterator,
<Self::Group as IntoIterator>::Item == Self,
Substitutes an Expression
into each Atom
of self
.
pub fn substitute_ref<F>(&self, f: F) -> Self where
F: FnMut(&Self::Atom) -> Self,
Self::Group: FromIterator<Self>,
[src]
F: FnMut(&Self::Atom) -> Self,
Self::Group: FromIterator<Self>,
Substitutes an Expression
into each Atom
of &self
.