Enum rational_deduction::Expr[][src]

pub enum Expr<E> where
    E: Expression
{ Atom(<E as Expression>::Atom), Group(<E as Expression>::Group), }

Canonical Concrete Expression Type

Variants

Atom(<E as Expression>::Atom)

Atomic element

Group(<E as Expression>::Group)

Grouped expression

Implementations

impl<E> Expr<E> where
    E: Expression
[src]

#[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 as Expression>::Atom>[src]

Converts from an Expr<E> to an Option<E::Atom>.

#[must_use]pub fn group(self) -> Option<<E as Expression>::Group>[src]

Converts from an Expr<E> to an Option<E::Group>.

pub fn unwrap_atom(self) -> <E as Expression>::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 as Expression>::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
    F: FnMut(<E as Expression>::Atom) -> <O as Expression>::Atom,
    O: Expression,
    <E as Expression>::Group: IntoIterator,
    <O as Expression>::Group: FromIterator<O>,
    <<E as Expression>::Group as IntoIterator>::Item == E, 
[src]

Extends a function on Atoms to a function on Expressions.

pub fn substitute<F>(self, f: F) -> E where
    F: FnMut(<E as Expression>::Atom) -> E,
    <E as Expression>::Group: FromIterator<E>,
    <E as Expression>::Group: IntoIterator,
    <<E as Expression>::Group as IntoIterator>::Item == E, 
[src]

Substitutes an Expression into each Atom of self.

Trait Implementations

impl<E> Clone for Expr<E> where
    E: Clone + Expression,
    <E as Expression>::Atom: Clone,
    <E as Expression>::Group: Clone
[src]

impl<E> Copy for Expr<E> where
    E: Copy + Expression,
    <E as Expression>::Atom: Copy,
    <E as Expression>::Group: Copy
[src]

impl<E> Debug for Expr<E> where
    E: Debug + Expression,
    <E as Expression>::Atom: Debug,
    <E as Expression>::Group: Debug
[src]

impl<E> Default for Expr<E> where
    E: Expression,
    <E as Expression>::Group: FromIterator<E>, 
[src]

pub fn default() -> Expr<E>[src]

Returns the empty group expression.

impl<E> Eq for Expr<E> where
    E: Eq + Expression,
    <E as Expression>::Atom: Eq,
    <E as Expression>::Group: Eq
[src]

impl<'e, E> From<ExprRef<'e, E>> for Expr<E> where
    E: Expression,
    <E as Expression>::Atom: Clone,
    <E as Expression>::Group: FromIterator<E>, 
[src]

impl<E, S> From<StoredShape<E, S>> for Expr<E> where
    E: Expression,
    S: Shape<E>, 
[src]

impl<E, V> From<Structure<E, V>> for Expr<E> where
    E: Expression,
    E::Group: FromIterator<E>,
    V: Container<Term<E>>, 
[src]

impl<E> From<Structure<E>> for Expr<E> where
    E: Expression,
    E::Group: FromIterator<E>, 
[src]

impl<E> Hash for Expr<E> where
    E: Hash + Expression,
    <E as Expression>::Atom: Hash,
    <E as Expression>::Group: Hash
[src]

impl<E> PartialEq<Expr<E>> for Expr<E> where
    E: PartialEq<E> + Expression,
    <E as Expression>::Atom: PartialEq<<E as Expression>::Atom>,
    <E as Expression>::Group: PartialEq<<E as Expression>::Group>, 
[src]

impl<E> StructuralEq for Expr<E> where
    E: Expression
[src]

impl<E> StructuralPartialEq for Expr<E> where
    E: Expression
[src]

impl<E> TryFrom<Expr<E>> for Structure<E> where
    E: Expression,
    E::Group: IntoIterator<Item = E>, 
[src]

type Error = <Structure<E> as Matcher<E>>::Error

The type returned in the event of a conversion error.

impl<E, V> TryFrom<Expr<E>> for Structure<E, V> where
    E: Expression,
    E::Group: IntoIterator<Item = E>,
    V: Container<Term<E>>, 
[src]

type Error = <Structure<E, V> as Matcher<E>>::Error

The type returned in the event of a conversion error.

impl<E, S> TryFrom<Expr<E>> for StoredShape<E, S> where
    E: Expression,
    S: Shape<E>, 
[src]

type Error = <S as Matcher<E>>::Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<E> Send for Expr<E> where
    <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

impl<E> Unpin for Expr<E> where
    <E as Expression>::Atom: Unpin,
    <E as Expression>::Group: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<E, S> Structure<E, S> for S where
    E: Expression,
    S: Into<Expr<E>> + TryFrom<Expr<E>>, 
[src]

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.