Enum exprz::ExprRef [−][src]
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]
E: Expression,
#[must_use]pub fn is_atom(&self) -> bool
[src]
#[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]
R: Expression,
E::Atom: PartialEq<R::Atom>,
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]
E::Atom: Clone,
E::Group: FromIterator<E>,
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]
O: Expression,
O::Group: FromIterator<O>,
F: FnMut(&E::Atom) -> O::Atom,
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]
E::Group: FromIterator<E>,
F: FnMut(&E::Atom) -> E,
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]
R: Expression,
E::Atom: PartialEq<R::Atom>,
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]
E: Expression,
GroupRef<'e, E>: Clone,
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'e, E> Copy for ExprRef<'e, E> where
E: Expression,
GroupRef<'e, E>: Copy,
[src]
E: Expression,
GroupRef<'e, E>: Copy,
impl<'e, E> From<&'e E> for ExprRef<'e, E> where
E: Expression,
[src]
E: Expression,
impl<'e, E> From<&'e Expr<E>> for ExprRef<'e, E> where
E: Expression,
[src]
E: Expression,
impl<'e, E> From<ExprRef<'e, E>> for Expr<E> where
E: Expression,
E::Atom: Clone,
E::Group: FromIterator<E>,
[src]
E: Expression,
E::Atom: Clone,
E::Group: FromIterator<E>,
impl<'l, 'r, L, R> PartialEq<ExprRef<'r, R>> for ExprRef<'l, L> where
L: Expression,
R: Expression,
L::Atom: PartialEq<R::Atom>,
[src]
L: Expression,
R: Expression,
L::Atom: PartialEq<R::Atom>,
fn eq(&self, other: &ExprRef<'r, R>) -> bool
[src]
Checks if two Expressions
are equal using
PartialEq
on their Atoms
.
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'e, E> Reference<'e, E> for ExprRef<'e, E> where
E: Expression,
[src]
E: Expression,
fn cases(self) -> Self
[src]
#[must_use]fn is_atom(self) -> bool where
Self: Sized,
[src]
Self: Sized,
#[must_use]fn is_group(self) -> bool where
Self: Sized,
[src]
Self: Sized,
#[must_use]fn atom(self) -> Option<&'e E::Atom> where
Self: Sized,
[src]
Self: Sized,
#[must_use]fn group(self) -> Option<GroupRef<'e, E>> where
Self: Sized,
[src]
Self: Sized,
fn to_owned(self) -> E where
Self: Sized,
E::Atom: Clone,
E::Group: FromIterator<E>,
[src]
Self: Sized,
E::Atom: Clone,
E::Group: FromIterator<E>,
fn substitute_ref<F>(self, f: F) -> E where
E::Group: FromIterator<E>,
F: FnMut(&E::Atom) -> E,
[src]
E::Group: FromIterator<E>,
F: FnMut(&E::Atom) -> E,
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,
<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,
<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,
<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,
<<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,
<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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,