Struct expr::scalar::MirScalarExprVisitor [−][src]
struct MirScalarExprVisitor {
recursion_guard: RecursionGuard,
}
Fields
recursion_guard: RecursionGuard
Implementations
Contains visitor implementations.
[child, pre, post] x [fallible, infallible] x [immutable, mutable]
Constructs a new MirScalarExprVisitor using a RecursionGuard
with RECURSION_LIMIT
.
fn visit_children<'a, F>(&self, expr: &'a MirScalarExpr, f: F) where
F: FnMut(&'a MirScalarExpr),
fn visit_children<'a, F>(&self, expr: &'a MirScalarExpr, f: F) where
F: FnMut(&'a MirScalarExpr),
Applies an infallible immutable f
to each expr
child of type MirScalarExpr
.
fn visit_mut_children<'a, F>(&self, expr: &'a mut MirScalarExpr, f: F) where
F: FnMut(&'a mut MirScalarExpr),
fn visit_mut_children<'a, F>(&self, expr: &'a mut MirScalarExpr, f: F) where
F: FnMut(&'a mut MirScalarExpr),
Applies an infallible mutable f
to each expr
child of type MirScalarExpr
.
fn visit_post<'a, F>(&self, expr: &'a MirScalarExpr, f: &mut F) where
F: FnMut(&'a MirScalarExpr),
fn visit_post<'a, F>(&self, expr: &'a MirScalarExpr, f: &mut F) where
F: FnMut(&'a MirScalarExpr),
Post-order immutable infallible MirScalarExpr
visitor for expr
.
Grows the recursion stack if needed in order to avoid stack overflow errors.
fn visit_mut_post<F>(&self, expr: &mut MirScalarExpr, f: &mut F) where
F: FnMut(&mut MirScalarExpr),
fn visit_mut_post<F>(&self, expr: &mut MirScalarExpr, f: &mut F) where
F: FnMut(&mut MirScalarExpr),
Post-order mutable infallible MirScalarExpr
visitor for expr
.
Grows the recursion stack if needed in order to avoid stack overflow errors.
pub fn visit_mut_pre_post<F1, F2>(
&self,
expr: &mut MirScalarExpr,
pre: &mut F1,
post: &mut F2
) where
F1: FnMut(&mut MirScalarExpr) -> Option<Vec<&mut MirScalarExpr>>,
F2: FnMut(&mut MirScalarExpr),
pub fn visit_mut_pre_post<F1, F2>(
&self,
expr: &mut MirScalarExpr,
pre: &mut F1,
post: &mut F2
) where
F1: FnMut(&mut MirScalarExpr) -> Option<Vec<&mut MirScalarExpr>>,
F2: FnMut(&mut MirScalarExpr),
A generalization of visit_mut
. The function pre
runs on a
MirScalarExpr
before it runs on any of the child MirScalarExpr
s.
The function post
runs on child MirScalarExpr
s first before the
parent. Optionally, pre
can return which child MirScalarExpr
s, if
any, should be visited (default is to visit all children).
Grows the recursion stack if needed in order to avoid stack overflow errors.
Trait Implementations
Add checked recursion support for MirScalarExprVisitor
.
Extracts a reference to the recursion guard embedded within the type.
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E> where
F: FnOnce(&Self) -> Result<T, E>,
E: From<RecursionLimitError>,
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E> where
F: FnOnce(&Self) -> Result<T, E>,
E: From<RecursionLimitError>,
Checks whether it is safe to recur and calls f
if so. Read more
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E> where
F: FnOnce(&mut Self) -> Result<T, E>,
E: From<RecursionLimitError>,
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E> where
F: FnOnce(&mut Self) -> Result<T, E>,
E: From<RecursionLimitError>,
Like CheckedRecursion::checked_recur
, but operates on a mutable
reference to Self
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for MirScalarExprVisitor
impl Send for MirScalarExprVisitor
impl !Sync for MirScalarExprVisitor
impl Unpin for MirScalarExprVisitor
impl UnwindSafe for MirScalarExprVisitor
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more