Enum exprz::ExprRef[][src]

pub enum ExprRef<'e, E> where
    E: 'e + Expression
{ Atom(&'e E::Atom), Group(GroupRef<'e, E>), }

Internal Reference to an Expression Type

Variants

Atom(&'e E::Atom)

Reference to an atomic expression

Group(GroupRef<'e, E>)

Reference to a grouped expression

Implementations

impl<'e, E> ExprRef<'e, E> where
    E: Expression
[src]

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

Checks if the ExprRef is an atomic expression &Atom.

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

Checks if the ExprRef is a grouped expression Group<E>::Ref.

#[must_use]pub fn atom(self) -> Option<&'e E::Atom>[src]

Converts from an [ExprRef<'e, E>] to an Option<&'e E::Atom>.

#[must_use]pub fn atom_ref(&self) -> Option<&'e E::Atom>[src]

Converts from an &ExprRef<'e, E> to an Option<&'e E::Atom>.

#[must_use]pub fn group(self) -> Option<GroupRef<'e, E>>[src]

Converts from an [ExprRef<'e, E>] to an Option<[GroupRef<'e, E>]>.

#[must_use]pub fn group_ref(&self) -> Option<&GroupRef<'e, E>>[src]

Converts from an [&ExprRef<'e, E>] to an Option<[&GroupRef<'e, E>]>`.

pub fn is_subexpression<'r, R>(&self, other: &ExprRef<'r, R>) -> bool where
    R: Expression,
    E::Atom: PartialEq<R::Atom>, 
[src]

Checks if an Expression is a sub-tree of another Expression using PartialEq on their Atoms.

pub fn to_owned(self) -> E where
    E::Atom: Clone,
    E::Group: FromIterator<E>, 
[src]

Returns new owned copy of the underlying expression.

pub fn map_ref<O, F>(&self, f: F) -> O where
    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_ref<F>(&self, f: F) -> E where
    E::Group: FromIterator<E>,
    F: FnMut(&E::Atom) -> E, 
[src]

Substitutes an Expression into each &Atom of &self.

pub fn eq_groups<'r, R>(lhs: &GroupRef<'e, E>, rhs: &GroupRef<'r, R>) -> bool where
    R: Expression,
    E::Atom: PartialEq<R::Atom>, 
[src]

Checks if two Group are equal pointwise.

Trait Implementations

impl<'e, E> Clone for ExprRef<'e, E> where
    E: Expression,
    GroupRef<'e, E>: Clone
[src]

impl<'e, E> Copy for ExprRef<'e, E> where
    E: Expression,
    GroupRef<'e, E>: Copy
[src]

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

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

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

impl<'l, 'r, L, R> PartialEq<ExprRef<'r, R>> for ExprRef<'l, L> where
    L: Expression,
    R: Expression,
    L::Atom: PartialEq<R::Atom>, 
[src]

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

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

impl<'e, E> Reference<'e, E> for ExprRef<'e, E> where
    E: Expression
[src]

Auto Trait Implementations

impl<'e, E> RefUnwindSafe for ExprRef<'e, E> where
    <E as Expression>::Atom: RefUnwindSafe,
    <<E as Expression>::Group as Group<E>>::Ref: RefUnwindSafe

impl<'e, E> Send for ExprRef<'e, E> where
    <E as Expression>::Atom: Sync,
    <<E as Expression>::Group as Group<E>>::Ref: Send

impl<'e, E> Sync for ExprRef<'e, E> where
    <E as Expression>::Atom: Sync,
    <<E as Expression>::Group as Group<E>>::Ref: Sync

impl<'e, E> Unpin for ExprRef<'e, E> where
    <<E as Expression>::Group as Group<E>>::Ref: Unpin

impl<'e, E> UnwindSafe for ExprRef<'e, E> where
    <E as Expression>::Atom: RefUnwindSafe,
    <<E as Expression>::Group as Group<E>>::Ref: 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.