[][src]Enum exprz_core::ExprRef

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

Internal Reference to an Expression Type

Variants

Atom(&'e E::Atom)

Reference to an atomic expression

Group(<E::Group as IntoIteratorGen<E>>::IterGen)

Grouped expression IteratorGen

Implementations

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

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

Check if the ExprRef is atomic.

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

Check if the ExprRef is a grouped expression IteratorGen.

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

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

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

Converts from an ExprRef<E> to an Option<E::Group::IterGen>.

pub fn unwrap_atom(self) -> &'e 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 as IntoIteratorGen<E>>::IterGen[src]

Returns the contained Group value, consuming the self value.

Panics

Panics if the self value is an Atom.

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

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

pub fn map_ref<O, F>(&self, f: F) -> O where
    O: Expression,
    O::Group: FromIterator<O>,
    F: FnMut(&E::Atom) -> O::Atom
[src]

Extend 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]

Substitute an Expression into each Atom of &self.

Trait Implementations

impl<'e, E> From<ExprRef<'e, E>> for Expr<E> where
    E::Atom: Clone,
    E::Group: FromIterator<E>,
    E: Expression
[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]

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

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

Auto Trait Implementations

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

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

impl<'e, E> Unpin for ExprRef<'e, E> where
    <<E as Expression>::Group as IntoIteratorGen<E>>::IterGen: 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> From<T> for T[src]

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

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.