[][src]Enum exprz::Expr

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]

Check if the Expr is atomic.

#[must_use]pub fn is_group(&self) -> bool[src]

Check 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.

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]

Default Expr

The default expression is 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> From<E> for Expr<E> where
    E: Expression
[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> Hash for Expr<E> where
    E: Hash + Expression,
    <E as Expression>::Atom: Hash,
    <E as Expression>::Group: Hash
[src]

impl<E> Ord for Expr<E> where
    E: Ord + Expression,
    <E as Expression>::Atom: Ord,
    <E as Expression>::Group: Ord
[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> PartialOrd<Expr<E>> for Expr<E> where
    E: PartialOrd<E> + Expression,
    <E as Expression>::Atom: PartialOrd<<E as Expression>::Atom>,
    <E as Expression>::Group: PartialOrd<<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]

Auto Trait Implementations

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

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

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

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> From<!> for T[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.