Enum rational_deduction::ExprRef[][src]

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]

Checks if the ExprRef is atomic.

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

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

Checks 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
    F: FnMut(&<E as Expression>::Atom) -> <O as Expression>::Atom,
    O: Expression,
    <O as Expression>::Group: FromIterator<O>, 
[src]

Extends a function on &Atoms to a function on &Expressions.

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

Substitutes an Expression into each Atom of &self.

pub fn eq_groups<R>(
    lhs: &<<E as Expression>::Group as IntoIteratorGen<E>>::IterGen,
    rhs: &<<R as Expression>::Group as IntoIteratorGen<R>>::IterGen
) -> bool where
    R: Expression,
    <E as Expression>::Atom: PartialEq<<R as Expression>::Atom>, 
[src]

Checks if two groups are equal.

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
    R: Expression,
    L: Expression,
    <L as Expression>::Atom: PartialEq<<R as Expression>::Atom>, 
[src]

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

Checks 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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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.