Trait swc_html_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§

source

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.

source

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 restored when this method returns.

This is the default implementaton of a handler method in FoldAstPath.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

Visit children nodes of self with v

source§

fn fold_with_path(self, v: &mut V, ast_path: &mut AstKindPath) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<Namespace>

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<Atom>

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Option<DocumentFragment>

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Child

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for DocumentMode

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Namespace

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<Child>

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Vec<Attribute>

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Atom

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Span

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Attribute

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Comment

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Document

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for DocumentFragment

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for DocumentType

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Element

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

source§

impl<V: ?Sized + FoldAstPath> FoldWithPath<V> for Text

source§

fn fold_with_path(self, v: &mut V, __ast_path: &mut AstKindPath) -> Self

source§

fn fold_children_with_path( self, v: &mut V, __ast_path: &mut AstKindPath ) -> Self

Implementors§