Trait swc_ecma_visit::FoldWithPath
source · pub trait FoldWithPath<V: ?Sized + FoldAstPath> {
// Required methods
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§
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<VarDeclOrExpr>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<VarDeclOrExpr>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsExportAssignment
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsExportAssignment
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsIntersectionType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsIntersectionType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Null
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Null
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElementChild
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElementChild
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Number
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Number
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ObjectPat
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ObjectPat
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<ImportSpecifier>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<ImportSpecifier>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElementName
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElementName
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<TsNamespaceBody>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<TsNamespaceBody>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JsWord
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JsWord
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<VarDeclarator>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<VarDeclarator>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MethodProp
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MethodProp
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Tpl
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Tpl
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ExprStmt
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ExprStmt
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXText
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXText
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<ModuleExportName>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<ModuleExportName>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<Stmt>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<Stmt>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Prop
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Prop
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsEnumMember
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsEnumMember
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TryStmt
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TryStmt
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsFnOrConstructorType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsFnOrConstructorType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElement
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXElement
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MethodKind
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MethodKind
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for LabeledStmt
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for LabeledStmt
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXObject
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXObject
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MemberExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for MemberExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for FnExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for FnExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsTplLitType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsTplLitType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Key
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Key
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsUnionType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsUnionType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for AutoAccessor
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for AutoAccessor
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<TsTypeElement>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<TsTypeElement>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXMemberExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXMemberExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsLit
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsLit
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsConditionalType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsConditionalType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ObjectLit
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ObjectLit
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ModuleDecl
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ModuleDecl
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsTypeRef
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsTypeRef
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsParamPropParam
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsParamPropParam
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Program
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Program
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ImportStarAsSpecifier
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ImportStarAsSpecifier
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<JSXClosingElement>
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<JSXClosingElement>
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXEmptyExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXEmptyExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsSetterSignature
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsSetterSignature
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for WithStmt
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for WithStmt
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXFragment
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXFragment
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsConstructorType
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for TsConstructorType
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for OptCall
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for OptCall
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for VarDeclOrExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for VarDeclOrExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Lit
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Lit
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ExportDecl
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ExportDecl
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for CallExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for CallExpr
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXExprContainer
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXExprContainer
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXAttrName
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for JSXAttrName
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for KeyValuePatProp
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for KeyValuePatProp
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ContinueStmt
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for ContinueStmt
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
source§impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for AssignExpr
impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for AssignExpr
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
source§impl<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>,
source§fn 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