Trait Visit

Source
pub trait Visit<N: ?Sized> {
    // Provided method
    fn visit<'n, D>(visitor: Visitor<'_, 'n, D, Self, N>, _node: &'n N)
       where D: Direct<Self, N> + ?Sized { ... }
}
Expand description

The action to be performed when visiting a node of type N. This trait must be implemented for all node types in the input, even if the visitor has no special handling for that type.

Provided Methods§

Source

fn visit<'n, D>(visitor: Visitor<'_, 'n, D, Self, N>, _node: &'n N)
where D: Direct<Self, N> + ?Sized,

Performs the visiting action. The default implementation simply calls Visitor::visit(visitor), which returns control to the Direct implementation to continue to further sub-nodes. If you wish to skip sub-nodes, simply omit this call from your implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§