Enum exprz::Expr [−][src]
Canonical Concrete Expression
Type
Variants
Atom(E::Atom)
Atomic element
Group(E::Group)
Grouped expression
Implementations
impl<E> Expr<E> where
E: Expression,
[src]
E: Expression,
#[must_use]pub fn is_atom(&self) -> bool
[src]
Checks if the Expr
is atomic.
#[must_use]pub fn is_group(&self) -> bool
[src]
Checks if the Expr
is a grouped expression.
#[must_use]pub fn atom(self) -> Option<E::Atom>
[src]
Converts from an Expr<E>
to an Option<E::Atom>
.
#[must_use]pub fn atom_ref(&self) -> Option<&E::Atom>
[src]
Converts from an &Expr<E>
to an Option<&E::Atom>
.
#[must_use]pub fn group(self) -> Option<E::Group>
[src]
Converts from an Expr<E>
to an Option<E::Group>
.
#[must_use]pub fn group_ref(&self) -> Option<&E::Group>
[src]
Converts from an &Expr<E>
to an Option<&E::Group>
.
pub fn unwrap_atom(self) -> E::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) -> E::Group
[src]
Returns the contained Group
value, consuming the self
value.
Panics
Panics if the self
value is an Atom
.
pub fn map<O, F>(self, f: F) -> O where
E::Group: IntoIterator<Item = E>,
O: Expression,
O::Group: FromIterator<O>,
F: FnMut(E::Atom) -> O::Atom,
[src]
E::Group: IntoIterator<Item = E>,
O: Expression,
O::Group: FromIterator<O>,
F: FnMut(E::Atom) -> O::Atom,
Extends a function on Atom
s to a function on Expression
s.
pub fn substitute<F>(self, f: F) -> E where
E::Group: FromIterator<E> + IntoIterator<Item = E>,
F: FnMut(E::Atom) -> E,
[src]
E::Group: FromIterator<E> + IntoIterator<Item = E>,
F: FnMut(E::Atom) -> E,
Substitutes an Expression
into each Atom
of self
.
Trait Implementations
impl<E: Clone> Clone for Expr<E> where
E: Expression,
E::Atom: Clone,
E::Group: Clone,
[src]
E: Expression,
E::Atom: Clone,
E::Group: Clone,
fn clone(&self) -> Expr<E>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<E: Copy> Copy for Expr<E> where
E: Expression,
E::Atom: Copy,
E::Group: Copy,
[src]
E: Expression,
E::Atom: Copy,
E::Group: Copy,
impl<E: Debug> Debug for Expr<E> where
E: Expression,
E::Atom: Debug,
E::Group: Debug,
[src]
E: Expression,
E::Atom: Debug,
E::Group: Debug,
impl<E> Default for Expr<E> where
E: Expression,
E::Group: FromIterator<E>,
[src]
E: Expression,
E::Group: FromIterator<E>,
impl<E: Eq> Eq for Expr<E> where
E: Expression,
E::Atom: Eq,
E::Group: Eq,
[src]
E: Expression,
E::Atom: Eq,
E::Group: Eq,
impl<A> From<Expr<A>> for Expr<Expr<A>>
[src]
alloc
only.impl<T> From<Expr<T, usize, usize>> for Expr<Expr<T>>
[src]
buffered
only.impl<'e, E> From<ExprRef<'e, E>> for Expr<E> where
E::Atom: Clone,
E::Group: FromIterator<E>,
E: Expression,
[src]
E::Atom: Clone,
E::Group: FromIterator<E>,
E: Expression,
impl<E> FromStr for Expr<E> where
E: Expression,
E::Atom: FromIterator<char>,
E::Group: FromIterator<E>,
[src]
E: Expression,
E::Atom: FromIterator<char>,
E::Group: FromIterator<E>,
parse
only.type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<E: Hash> Hash for Expr<E> where
E: Expression,
E::Atom: Hash,
E::Group: Hash,
[src]
E: Expression,
E::Atom: Hash,
E::Group: Hash,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<E: PartialEq> PartialEq<Expr<E>> for Expr<E> where
E: Expression,
E::Atom: PartialEq,
E::Group: PartialEq,
[src]
E: Expression,
E::Atom: PartialEq,
E::Group: PartialEq,
impl<E> StructuralEq for Expr<E> where
E: Expression,
[src]
E: Expression,
impl<E> StructuralPartialEq for Expr<E> where
E: Expression,
[src]
E: Expression,
Auto Trait Implementations
impl<E> Send for Expr<E> where
<E as Expression>::Atom: Send,
<E as Expression>::Group: Send,
<E as Expression>::Atom: Send,
<E as Expression>::Group: Send,
impl<E> Sync for Expr<E> where
<E as Expression>::Atom: Sync,
<E as Expression>::Group: Sync,
<E as Expression>::Atom: Sync,
<E as Expression>::Group: Sync,
impl<E> Unpin for Expr<E> where
<E as Expression>::Atom: Unpin,
<E as Expression>::Group: Unpin,
<E as Expression>::Atom: Unpin,
<E as Expression>::Group: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,