pub trait Visit {
Show 20 methods fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
    where
        F: FnMut(&Self)
; fn visit_post_nolimit<F>(&self, f: &mut F)
    where
        F: FnMut(&Self)
; fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
    where
        F: FnMut(&mut Self)
; fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)
    where
        F: FnMut(&mut Self)
; fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>
    where
        F: FnMut(&Self) -> Result<(), E>,
        E: From<RecursionLimitError>
; fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>
    where
        F: FnMut(&mut Self) -> Result<(), E>,
        E: From<RecursionLimitError>
; fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
    where
        F: FnMut(&Self)
; fn visit_pre_nolimit<F>(&self, f: &mut F)
    where
        F: FnMut(&Self)
; fn visit_mut_pre<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>
    where
        F: FnMut(&mut Self)
; fn visit_mut_pre_nolimit<F>(&mut self, f: &mut F)
    where
        F: FnMut(&mut Self)
; fn try_visit_pre<F, E>(&self, f: &mut F) -> Result<(), E>
    where
        F: FnMut(&Self) -> Result<(), E>,
        E: From<RecursionLimitError>
; fn try_visit_mut_pre<F, E>(&mut self, f: &mut F) -> Result<(), E>
    where
        F: FnMut(&mut Self) -> Result<(), E>,
        E: From<RecursionLimitError>
; fn visit_pre_post<F1, F2>(
        &self,
        pre: &mut F1,
        post: &mut F2
    ) -> Result<(), RecursionLimitError>
    where
        F1: FnMut(&Self) -> Option<Vec<&Self>>,
        F2: FnMut(&Self)
; fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)
    where
        F1: FnMut(&Self) -> Option<Vec<&Self>>,
        F2: FnMut(&Self)
; fn visit_mut_pre_post<F1, F2>(
        &mut self,
        pre: &mut F1,
        post: &mut F2
    ) -> Result<(), RecursionLimitError>
    where
        F1: FnMut(&mut Self) -> Option<Vec<&mut Self>>,
        F2: FnMut(&mut Self)
; fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)
    where
        F1: FnMut(&mut Self) -> Option<Vec<&mut Self>>,
        F2: FnMut(&mut Self)
; fn visit<V>(&self, visitor: &mut V) -> Result<(), RecursionLimitError>
    where
        Self: Sized,
        V: Visitor<Self>
; fn visit_mut<V>(
        &mut self,
        visitor: &mut V
    ) -> Result<(), RecursionLimitError>
    where
        Self: Sized,
        V: VisitorMut<Self>
; fn try_visit<V, E>(&self, visitor: &mut V) -> Result<(), E>
    where
        Self: Sized,
        V: TryVisitor<Self, E>,
        E: From<RecursionLimitError>
; fn try_visit_mut<V, E>(&mut self, visitor: &mut V) -> Result<(), E>
    where
        Self: Sized,
        V: TryVisitorMut<Self, E>,
        E: From<RecursionLimitError>
;
}
Expand description

A trait for types that can recursively visit their children of the same type.

This trait is automatically implemented for all implementors of VisitChildren.

All methods provided by this trait ensure that the stack is grown as needed, to avoid stack overflows when traversing deeply recursive objects. They also enforce a recursion limit of RECURSION_LIMIT by returning an error when that limit is exceeded.

There are also *_nolimit methods that don’t enforce a recursion limit. Those methods are deprecated and should not be used.

Required Methods

source

fn visit_post<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>where
    F: FnMut(&Self),

Post-order immutable infallible visitor for self.

source

fn visit_post_nolimit<F>(&self, f: &mut F)where
    F: FnMut(&Self),

👎Deprecated: Use visit_post instead.

Post-order immutable infallible visitor for self. Does not enforce a recursion limit.

source

fn visit_mut_post<F>(&mut self, f: &mut F) -> Result<(), RecursionLimitError>where
    F: FnMut(&mut Self),

Post-order mutable infallible visitor for self.

source

fn visit_mut_post_nolimit<F>(&mut self, f: &mut F)where
    F: FnMut(&mut Self),

👎Deprecated: Use visit_mut_post instead.

Post-order mutable infallible visitor for self. Does not enforce a recursion limit.

source

fn try_visit_post<F, E>(&self, f: &mut F) -> Result<(), E>where
    F: FnMut(&Self) -> Result<(), E>,
    E: From<RecursionLimitError>,

Post-order immutable fallible visitor for self.

source

fn try_visit_mut_post<F, E>(&mut self, f: &mut F) -> Result<(), E>where
    F: FnMut(&mut Self) -> Result<(), E>,
    E: From<RecursionLimitError>,

Post-order mutable fallible visitor for self.

Pre-order immutable infallible visitor for self.

👎Deprecated: Use visit_pre instead.

Pre-order immutable infallible visitor for self. Does not enforce a recursion limit.

Pre-order mutable infallible visitor for self.

👎Deprecated: Use visit_mut_pre instead.

Pre-order mutable infallible visitor for self. Does not enforce a recursion limit.

Pre-order immutable fallible visitor for self.

Pre-order mutable fallible visitor for self.

source

fn visit_pre_post<F1, F2>(
    &self,
    pre: &mut F1,
    post: &mut F2
) -> Result<(), RecursionLimitError>where
    F1: FnMut(&Self) -> Option<Vec<&Self>>,
    F2: FnMut(&Self),

A generalization of Visit::visit_pre and Visit::visit_post.

The function pre runs on self before it runs on any of the children. The function post runs on children first before the parent.

Optionally, pre can return which children, if any, should be visited (default is to visit all children).

source

fn visit_pre_post_nolimit<F1, F2>(&self, pre: &mut F1, post: &mut F2)where
    F1: FnMut(&Self) -> Option<Vec<&Self>>,
    F2: FnMut(&Self),

👎Deprecated: Use visit instead.

A generalization of Visit::visit_pre and Visit::visit_post. Does not enforce a recursion limit.

The function pre runs on self before it runs on any of the children. The function post runs on children first before the parent.

Optionally, pre can return which children, if any, should be visited (default is to visit all children).

source

fn visit_mut_pre_post<F1, F2>(
    &mut self,
    pre: &mut F1,
    post: &mut F2
) -> Result<(), RecursionLimitError>where
    F1: FnMut(&mut Self) -> Option<Vec<&mut Self>>,
    F2: FnMut(&mut Self),

👎Deprecated: Use visit_mut instead.

A generalization of Visit::visit_mut_pre and Visit::visit_mut_post.

The function pre runs on self before it runs on any of the children. The function post runs on children first before the parent.

Optionally, pre can return which children, if any, should be visited (default is to visit all children).

source

fn visit_mut_pre_post_nolimit<F1, F2>(&mut self, pre: &mut F1, post: &mut F2)where
    F1: FnMut(&mut Self) -> Option<Vec<&mut Self>>,
    F2: FnMut(&mut Self),

👎Deprecated: Use visit_mut_pre_post instead.

A generalization of Visit::visit_mut_pre and Visit::visit_mut_post. Does not enforce a recursion limit.

The function pre runs on self before it runs on any of the children. The function post runs on children first before the parent.

Optionally, pre can return which children, if any, should be visited (default is to visit all children).

Implementors