[][src]Enum exprz::ExprRef

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

Internal Reference to an Expression Type

Variants

Atom(&'e <E as Expression>::Atom)

Reference to an atomic expression

Group(<<E as Expression>::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 as Expression>::Atom>[src]

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

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

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

pub fn unwrap_atom(self) -> &'e <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 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>(&self, other: &ExprRef<'r, R>) -> bool where
    R: Expression,
    <E as Expression>::Atom: PartialEq<<R as Expression>::Atom>, 
[src]

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

Trait Implementations

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<'l, 'r, L, R> PartialEq<ExprRef<'r, R>> for ExprRef<'l, L> where
    L: Expression,
    R: Expression,
    <L as Expression>::Atom: PartialEq<<R as Expression>::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> RefUnwindSafe for ExprRef<'e, E> where
    <E as Expression>::Atom: RefUnwindSafe,
    <<E as Expression>::Group as IntoIteratorGen<E>>::IterGen: RefUnwindSafe

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

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