pub trait Visit {
Show 21 methods
// Provided methods
fn visit_atom(&mut self, node: &Atom) { ... }
fn visit_attribute(&mut self, node: &Attribute) { ... }
fn visit_attribute_token(&mut self, node: &AttributeToken) { ... }
fn visit_attribute_tokens(&mut self, node: &[AttributeToken]) { ... }
fn visit_attributes(&mut self, node: &[Attribute]) { ... }
fn visit_cdata_section(&mut self, node: &CdataSection) { ... }
fn visit_child(&mut self, node: &Child) { ... }
fn visit_childs(&mut self, node: &[Child]) { ... }
fn visit_comment(&mut self, node: &Comment) { ... }
fn visit_document(&mut self, node: &Document) { ... }
fn visit_document_mode(&mut self, node: &DocumentMode) { ... }
fn visit_document_type(&mut self, node: &DocumentType) { ... }
fn visit_element(&mut self, node: &Element) { ... }
fn visit_namespace(&mut self, node: &Namespace) { ... }
fn visit_opt_atom(&mut self, node: &Option<Atom>) { ... }
fn visit_opt_namespace(&mut self, node: &Option<Namespace>) { ... }
fn visit_processing_instruction(&mut self, node: &ProcessingInstruction) { ... }
fn visit_span(&mut self, node: &Span) { ... }
fn visit_text(&mut self, node: &Text) { ... }
fn visit_token(&mut self, node: &Token) { ... }
fn visit_token_and_span(&mut self, node: &TokenAndSpan) { ... }
}
Expand description
A visitor trait for traversing the AST.
Provided Methods§
sourcefn visit_atom(&mut self, node: &Atom)
fn visit_atom(&mut self, node: &Atom)
Visit a node of type swc_atoms :: Atom
.
By default, this method calls [swc_atoms :: Atom::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute(&mut self, node: &Attribute)
fn visit_attribute(&mut self, node: &Attribute)
Visit a node of type Attribute
.
By default, this method calls [Attribute::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute_token(&mut self, node: &AttributeToken)
fn visit_attribute_token(&mut self, node: &AttributeToken)
Visit a node of type AttributeToken
.
By default, this method calls [AttributeToken::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_attribute_tokens(&mut self, node: &[AttributeToken])
fn visit_attribute_tokens(&mut self, node: &[AttributeToken])
Visit a node of type Vec < AttributeToken >
.
By default, this method calls [Vec < AttributeToken >::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_attributes(&mut self, node: &[Attribute])
fn visit_attributes(&mut self, node: &[Attribute])
Visit a node of type Vec < Attribute >
.
By default, this method calls [Vec < Attribute >::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_cdata_section(&mut self, node: &CdataSection)
fn visit_cdata_section(&mut self, node: &CdataSection)
Visit a node of type CdataSection
.
By default, this method calls [CdataSection::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_child(&mut self, node: &Child)
fn visit_child(&mut self, node: &Child)
Visit a node of type Child
.
By default, this method calls [Child::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_childs(&mut self, node: &[Child])
fn visit_childs(&mut self, node: &[Child])
Visit a node of type Vec < Child >
.
By default, this method calls [Vec < Child >::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_comment(&mut self, node: &Comment)
fn visit_comment(&mut self, node: &Comment)
Visit a node of type Comment
.
By default, this method calls [Comment::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_document(&mut self, node: &Document)
fn visit_document(&mut self, node: &Document)
Visit a node of type Document
.
By default, this method calls [Document::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_document_mode(&mut self, node: &DocumentMode)
fn visit_document_mode(&mut self, node: &DocumentMode)
Visit a node of type DocumentMode
.
By default, this method calls [DocumentMode::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_document_type(&mut self, node: &DocumentType)
fn visit_document_type(&mut self, node: &DocumentType)
Visit a node of type DocumentType
.
By default, this method calls [DocumentType::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_element(&mut self, node: &Element)
fn visit_element(&mut self, node: &Element)
Visit a node of type Element
.
By default, this method calls [Element::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_namespace(&mut self, node: &Namespace)
fn visit_namespace(&mut self, node: &Namespace)
Visit a node of type Namespace
.
By default, this method calls [Namespace::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_atom(&mut self, node: &Option<Atom>)
fn visit_opt_atom(&mut self, node: &Option<Atom>)
Visit a node of type Option < swc_atoms :: Atom >
.
By default, this method calls [Option < swc_atoms :: Atom >::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_opt_namespace(&mut self, node: &Option<Namespace>)
fn visit_opt_namespace(&mut self, node: &Option<Namespace>)
Visit a node of type Option < Namespace >
.
By default, this method calls [Option < Namespace >::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_processing_instruction(&mut self, node: &ProcessingInstruction)
fn visit_processing_instruction(&mut self, node: &ProcessingInstruction)
Visit a node of type ProcessingInstruction
.
By default, this method calls [ProcessingInstruction::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_span(&mut self, node: &Span)
fn visit_span(&mut self, node: &Span)
Visit a node of type swc_common :: Span
.
By default, this method calls [swc_common :: Span::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_text(&mut self, node: &Text)
fn visit_text(&mut self, node: &Text)
Visit a node of type Text
.
By default, this method calls [Text::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_token(&mut self, node: &Token)
fn visit_token(&mut self, node: &Token)
Visit a node of type Token
.
By default, this method calls [Token::visit_children_with
]. If you want to recurse, you need to call it manually.
sourcefn visit_token_and_span(&mut self, node: &TokenAndSpan)
fn visit_token_and_span(&mut self, node: &TokenAndSpan)
Visit a node of type TokenAndSpan
.
By default, this method calls [TokenAndSpan::visit_children_with
]. If you want to recurse, you need to call it manually.