Enum exprz::Expr[][src]

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

Canonical Concrete Expression Type

Variants

Atom(E::Atom)

Atomic element

Group(E::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 an atomic expression.

#[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 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]

Extends a function on Atoms to a function on Expressions.

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

Substitutes an Expression into each Atom of self.

Trait Implementations

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

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

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

fn default() -> Self[src]

Returns the empty group expression.

impl<E> Eq for Expr<E> where
    E: Expression,
    E::Atom: PartialEq
[src]

impl<'e, E> From<&'e Expr<E>> for ExprRef<'e, E> where
    E: Expression
[src]

impl<A> From<Expr<A>> for Expr<Expr<A>>[src]

This is supported on crate feature alloc only.

impl<T> From<Expr<T, usize, usize>> for Expr<Expr<T>>[src]

This is supported on crate feature buffered only.

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

impl<A, G> From<MultiExpr<A, G>> for Expr<MultiExpr<A, G>>[src]

This is supported on crate features multi and alloc only.

impl<E> FromStr for Expr<E> where
    E: Expression,
    E::Atom: FromIterator<char>,
    E::Group: FromIterator<E>, 
[src]

This is supported on crate feature parse only.

type Err = Error<FromCharactersParseError>

The associated error which can be returned from parsing.

impl<L, R> PartialEq<Expr<R>> for Expr<L> where
    L: Expression,
    R: Expression,
    L::Atom: PartialEq<R::Atom>, 
[src]

fn eq(&self, other: &Expr<R>) -> bool[src]

Checks if two Expressions are equal using PartialEq on their Atoms.

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.