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.

Applies an infallible immutable f to each expr child of type 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), 

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), 

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), 

A generalization of visit_mut. The function pre runs on a MirScalarExpr before it runs on any of the child MirScalarExprs. The function post runs on child MirScalarExprs first before the parent. Optionally, pre can return which child MirScalarExprs, 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.

Checks whether it is safe to recur and calls f if so. Read more

Like CheckedRecursion::checked_recur, but operates on a mutable reference to Self. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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