Trait swc_ecma_visit::FoldWithPath
source · [−]pub trait FoldWithPath<V: ?Sized + FoldAstPath> {
fn fold_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self;
fn fold_children_with_path(
self,
v: &mut V,
ast_path: &mut AstKindPath
) -> Self;
}
Available on crate feature
path
only.Expand description
A utility trait implemented for ast nodes, and allow to visit them with a visitor.
Required Methods
sourcefn fold_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
fn fold_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
Calls a visitor method (v.fold_xxx) with self and the ast path.
sourcefn fold_children_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
fn fold_children_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
Visit children nodes with v and ast path appended
[AstKind] of self
. The ast path will
be resotred when this method returns.
This is the default implementaton of a handler method in FoldAstPath.
Implementations on Foreign Types
sourceimpl<V, T> FoldWithPath<V> for Box<T>where
V: ?Sized + FoldAstPath,
T: 'static + FoldWithPath<V>,
impl<V, T> FoldWithPath<V> for Box<T>where
V: ?Sized + FoldAstPath,
T: 'static + FoldWithPath<V>,
sourcefn fold_children_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
fn fold_children_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self
Visit children nodes of self with v