Trait dprint_swc_ext::view::NodeTrait

source ·
pub trait NodeTrait<'a>: SourceRanged + Sized {
Show 28 methods // Required methods fn parent(&self) -> Option<Node<'a>>; fn children(&self) -> Vec<Node<'a>>; fn as_node(&self) -> Node<'a>; fn kind(&self) -> NodeKind; // Provided methods fn ancestors(&self) -> AncestorIterator<'a> { ... } fn start_line(&self) -> usize { ... } fn end_line(&self) -> usize { ... } fn start_column(&self) -> usize { ... } fn end_column(&self) -> usize { ... } fn char_width(&self) -> usize { ... } fn child_index(&self) -> usize { ... } fn previous_sibling(&self) -> Option<Node<'a>> { ... } fn previous_siblings(&self) -> Vec<Node<'a>> { ... } fn next_sibling(&self) -> Option<Node<'a>> { ... } fn next_siblings(&self) -> Vec<Node<'a>> { ... } fn tokens(&self) -> &'a [TokenAndSpan] { ... } fn children_with_tokens(&self) -> Vec<NodeOrToken<'a>> { ... } fn children_with_tokens_fast( &self, program: impl RootNode<'a>, ) -> Vec<NodeOrToken<'a>> { ... } fn leading_comments(&self) -> CommentsIterator<'a> { ... } fn trailing_comments(&self) -> CommentsIterator<'a> { ... } fn program(&self) -> Program<'a> { ... } fn module(&self) -> &Module<'a> { ... } fn script(&self) -> &Script<'a> { ... } fn text(&self) -> &'a str { ... } fn previous_token(&self) -> Option<&'a TokenAndSpan> { ... } fn next_token(&self) -> Option<&'a TokenAndSpan> { ... } fn previous_tokens(&self) -> &'a [TokenAndSpan] { ... } fn next_tokens(&self) -> &'a [TokenAndSpan] { ... }
}

Required Methods§

source

fn parent(&self) -> Option<Node<'a>>

source

fn children(&self) -> Vec<Node<'a>>

source

fn as_node(&self) -> Node<'a>

source

fn kind(&self) -> NodeKind

Provided Methods§

source

fn ancestors(&self) -> AncestorIterator<'a>

source

fn start_line(&self) -> usize

source

fn end_line(&self) -> usize

source

fn start_column(&self) -> usize

source

fn end_column(&self) -> usize

source

fn char_width(&self) -> usize

source

fn child_index(&self) -> usize

source

fn previous_sibling(&self) -> Option<Node<'a>>

source

fn previous_siblings(&self) -> Vec<Node<'a>>

Gets the previous siblings in the order they appear in the file.

source

fn next_sibling(&self) -> Option<Node<'a>>

Gets the next siblings in the order they appear in the file.

source

fn next_siblings(&self) -> Vec<Node<'a>>

source

fn tokens(&self) -> &'a [TokenAndSpan]

source

fn children_with_tokens(&self) -> Vec<NodeOrToken<'a>>

source

fn children_with_tokens_fast( &self, program: impl RootNode<'a>, ) -> Vec<NodeOrToken<'a>>

source

fn leading_comments(&self) -> CommentsIterator<'a>

source

fn trailing_comments(&self) -> CommentsIterator<'a>

source

fn program(&self) -> Program<'a>

Gets the root node.

source

fn module(&self) -> &Module<'a>

Gets the root node if the view was created from a Module; otherwise panics.

source

fn script(&self) -> &Script<'a>

Gets the root node if the view was created from a Script; otherwise panics.

source

fn text(&self) -> &'a str

source

fn previous_token(&self) -> Option<&'a TokenAndSpan>

source

fn next_token(&self) -> Option<&'a TokenAndSpan>

source

fn previous_tokens(&self) -> &'a [TokenAndSpan]

Gets the previous tokens in the order they appear in the file.

source

fn next_tokens(&self) -> &'a [TokenAndSpan]

Gets the next tokens in the order they appear in the file.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> NodeTrait<'a> for AssignTarget<'a>

source§

impl<'a> NodeTrait<'a> for AssignTargetPat<'a>

source§

impl<'a> NodeTrait<'a> for BlockStmtOrExpr<'a>

source§

impl<'a> NodeTrait<'a> for Callee<'a>

source§

impl<'a> NodeTrait<'a> for ClassMember<'a>

source§

impl<'a> NodeTrait<'a> for Decl<'a>

source§

impl<'a> NodeTrait<'a> for DefaultDecl<'a>

source§

impl<'a> NodeTrait<'a> for ExportSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for Expr<'a>

source§

impl<'a> NodeTrait<'a> for ForHead<'a>

source§

impl<'a> NodeTrait<'a> for ImportSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for JSXAttrName<'a>

source§

impl<'a> NodeTrait<'a> for JSXAttrOrSpread<'a>

source§

impl<'a> NodeTrait<'a> for JSXAttrValue<'a>

source§

impl<'a> NodeTrait<'a> for JSXElementChild<'a>

source§

impl<'a> NodeTrait<'a> for JSXElementName<'a>

source§

impl<'a> NodeTrait<'a> for JSXExpr<'a>

source§

impl<'a> NodeTrait<'a> for JSXObject<'a>

source§

impl<'a> NodeTrait<'a> for Key<'a>

source§

impl<'a> NodeTrait<'a> for Lit<'a>

source§

impl<'a> NodeTrait<'a> for MemberProp<'a>

source§

impl<'a> NodeTrait<'a> for ModuleDecl<'a>

source§

impl<'a> NodeTrait<'a> for ModuleExportName<'a>

source§

impl<'a> NodeTrait<'a> for ModuleItem<'a>

source§

impl<'a> NodeTrait<'a> for Node<'a>

source§

impl<'a> NodeTrait<'a> for ObjectPatProp<'a>

source§

impl<'a> NodeTrait<'a> for OptChainBase<'a>

source§

impl<'a> NodeTrait<'a> for ParamOrTsParamProp<'a>

source§

impl<'a> NodeTrait<'a> for Pat<'a>

source§

impl<'a> NodeTrait<'a> for Program<'a>

source§

impl<'a> NodeTrait<'a> for Prop<'a>

source§

impl<'a> NodeTrait<'a> for PropName<'a>

source§

impl<'a> NodeTrait<'a> for PropOrSpread<'a>

source§

impl<'a> NodeTrait<'a> for SimpleAssignTarget<'a>

source§

impl<'a> NodeTrait<'a> for Stmt<'a>

source§

impl<'a> NodeTrait<'a> for SuperProp<'a>

source§

impl<'a> NodeTrait<'a> for TsEntityName<'a>

source§

impl<'a> NodeTrait<'a> for TsEnumMemberId<'a>

source§

impl<'a> NodeTrait<'a> for TsFnOrConstructorType<'a>

source§

impl<'a> NodeTrait<'a> for TsFnParam<'a>

source§

impl<'a> NodeTrait<'a> for TsLit<'a>

source§

impl<'a> NodeTrait<'a> for TsModuleName<'a>

source§

impl<'a> NodeTrait<'a> for TsModuleRef<'a>

source§

impl<'a> NodeTrait<'a> for TsNamespaceBody<'a>

source§

impl<'a> NodeTrait<'a> for TsParamPropParam<'a>

source§

impl<'a> NodeTrait<'a> for TsThisTypeOrIdent<'a>

source§

impl<'a> NodeTrait<'a> for TsType<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeElement<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeQueryExpr<'a>

source§

impl<'a> NodeTrait<'a> for TsUnionOrIntersectionType<'a>

source§

impl<'a> NodeTrait<'a> for VarDeclOrExpr<'a>

source§

impl<'a> NodeTrait<'a> for ArrayLit<'a>

source§

impl<'a> NodeTrait<'a> for ArrayPat<'a>

source§

impl<'a> NodeTrait<'a> for ArrowExpr<'a>

source§

impl<'a> NodeTrait<'a> for AssignExpr<'a>

source§

impl<'a> NodeTrait<'a> for AssignPat<'a>

source§

impl<'a> NodeTrait<'a> for AssignPatProp<'a>

source§

impl<'a> NodeTrait<'a> for AssignProp<'a>

source§

impl<'a> NodeTrait<'a> for AutoAccessor<'a>

source§

impl<'a> NodeTrait<'a> for AwaitExpr<'a>

source§

impl<'a> NodeTrait<'a> for BigInt<'a>

source§

impl<'a> NodeTrait<'a> for BinExpr<'a>

source§

impl<'a> NodeTrait<'a> for BindingIdent<'a>

source§

impl<'a> NodeTrait<'a> for BlockStmt<'a>

source§

impl<'a> NodeTrait<'a> for Bool<'a>

source§

impl<'a> NodeTrait<'a> for BreakStmt<'a>

source§

impl<'a> NodeTrait<'a> for CallExpr<'a>

source§

impl<'a> NodeTrait<'a> for CatchClause<'a>

source§

impl<'a> NodeTrait<'a> for Class<'a>

source§

impl<'a> NodeTrait<'a> for ClassDecl<'a>

source§

impl<'a> NodeTrait<'a> for ClassExpr<'a>

source§

impl<'a> NodeTrait<'a> for ClassMethod<'a>

source§

impl<'a> NodeTrait<'a> for ClassProp<'a>

source§

impl<'a> NodeTrait<'a> for ComputedPropName<'a>

source§

impl<'a> NodeTrait<'a> for CondExpr<'a>

source§

impl<'a> NodeTrait<'a> for Constructor<'a>

source§

impl<'a> NodeTrait<'a> for ContinueStmt<'a>

source§

impl<'a> NodeTrait<'a> for DebuggerStmt<'a>

source§

impl<'a> NodeTrait<'a> for Decorator<'a>

source§

impl<'a> NodeTrait<'a> for DoWhileStmt<'a>

source§

impl<'a> NodeTrait<'a> for EmptyStmt<'a>

source§

impl<'a> NodeTrait<'a> for ExportAll<'a>

source§

impl<'a> NodeTrait<'a> for ExportDecl<'a>

source§

impl<'a> NodeTrait<'a> for ExportDefaultDecl<'a>

source§

impl<'a> NodeTrait<'a> for ExportDefaultExpr<'a>

source§

impl<'a> NodeTrait<'a> for ExportDefaultSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for ExportNamedSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for ExportNamespaceSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for ExprOrSpread<'a>

source§

impl<'a> NodeTrait<'a> for ExprStmt<'a>

source§

impl<'a> NodeTrait<'a> for FnDecl<'a>

source§

impl<'a> NodeTrait<'a> for FnExpr<'a>

source§

impl<'a> NodeTrait<'a> for ForInStmt<'a>

source§

impl<'a> NodeTrait<'a> for ForOfStmt<'a>

source§

impl<'a> NodeTrait<'a> for ForStmt<'a>

source§

impl<'a> NodeTrait<'a> for Function<'a>

source§

impl<'a> NodeTrait<'a> for GetterProp<'a>

source§

impl<'a> NodeTrait<'a> for Ident<'a>

source§

impl<'a> NodeTrait<'a> for IdentName<'a>

source§

impl<'a> NodeTrait<'a> for IfStmt<'a>

source§

impl<'a> NodeTrait<'a> for Import<'a>

source§

impl<'a> NodeTrait<'a> for ImportDecl<'a>

source§

impl<'a> NodeTrait<'a> for ImportDefaultSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for ImportNamedSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for ImportStarAsSpecifier<'a>

source§

impl<'a> NodeTrait<'a> for Invalid<'a>

source§

impl<'a> NodeTrait<'a> for JSXAttr<'a>

source§

impl<'a> NodeTrait<'a> for JSXClosingElement<'a>

source§

impl<'a> NodeTrait<'a> for JSXClosingFragment<'a>

source§

impl<'a> NodeTrait<'a> for JSXElement<'a>

source§

impl<'a> NodeTrait<'a> for JSXEmptyExpr<'a>

source§

impl<'a> NodeTrait<'a> for JSXExprContainer<'a>

source§

impl<'a> NodeTrait<'a> for JSXFragment<'a>

source§

impl<'a> NodeTrait<'a> for JSXMemberExpr<'a>

source§

impl<'a> NodeTrait<'a> for JSXNamespacedName<'a>

source§

impl<'a> NodeTrait<'a> for JSXOpeningElement<'a>

source§

impl<'a> NodeTrait<'a> for JSXOpeningFragment<'a>

source§

impl<'a> NodeTrait<'a> for JSXSpreadChild<'a>

source§

impl<'a> NodeTrait<'a> for JSXText<'a>

source§

impl<'a> NodeTrait<'a> for KeyValuePatProp<'a>

source§

impl<'a> NodeTrait<'a> for KeyValueProp<'a>

source§

impl<'a> NodeTrait<'a> for LabeledStmt<'a>

source§

impl<'a> NodeTrait<'a> for MemberExpr<'a>

source§

impl<'a> NodeTrait<'a> for MetaPropExpr<'a>

source§

impl<'a> NodeTrait<'a> for MethodProp<'a>

source§

impl<'a> NodeTrait<'a> for Module<'a>

source§

impl<'a> NodeTrait<'a> for NamedExport<'a>

source§

impl<'a> NodeTrait<'a> for NewExpr<'a>

source§

impl<'a> NodeTrait<'a> for Null<'a>

source§

impl<'a> NodeTrait<'a> for Number<'a>

source§

impl<'a> NodeTrait<'a> for ObjectLit<'a>

source§

impl<'a> NodeTrait<'a> for ObjectPat<'a>

source§

impl<'a> NodeTrait<'a> for OptCall<'a>

source§

impl<'a> NodeTrait<'a> for OptChainExpr<'a>

source§

impl<'a> NodeTrait<'a> for Param<'a>

source§

impl<'a> NodeTrait<'a> for ParenExpr<'a>

source§

impl<'a> NodeTrait<'a> for PrivateMethod<'a>

source§

impl<'a> NodeTrait<'a> for PrivateName<'a>

source§

impl<'a> NodeTrait<'a> for PrivateProp<'a>

source§

impl<'a> NodeTrait<'a> for Regex<'a>

source§

impl<'a> NodeTrait<'a> for RestPat<'a>

source§

impl<'a> NodeTrait<'a> for ReturnStmt<'a>

source§

impl<'a> NodeTrait<'a> for Script<'a>

source§

impl<'a> NodeTrait<'a> for SeqExpr<'a>

source§

impl<'a> NodeTrait<'a> for SetterProp<'a>

source§

impl<'a> NodeTrait<'a> for SpreadElement<'a>

source§

impl<'a> NodeTrait<'a> for StaticBlock<'a>

source§

impl<'a> NodeTrait<'a> for Str<'a>

source§

impl<'a> NodeTrait<'a> for Super<'a>

source§

impl<'a> NodeTrait<'a> for SuperPropExpr<'a>

source§

impl<'a> NodeTrait<'a> for SwitchCase<'a>

source§

impl<'a> NodeTrait<'a> for SwitchStmt<'a>

source§

impl<'a> NodeTrait<'a> for TaggedTpl<'a>

source§

impl<'a> NodeTrait<'a> for ThisExpr<'a>

source§

impl<'a> NodeTrait<'a> for ThrowStmt<'a>

source§

impl<'a> NodeTrait<'a> for Tpl<'a>

source§

impl<'a> NodeTrait<'a> for TplElement<'a>

source§

impl<'a> NodeTrait<'a> for TryStmt<'a>

source§

impl<'a> NodeTrait<'a> for TsArrayType<'a>

source§

impl<'a> NodeTrait<'a> for TsAsExpr<'a>

source§

impl<'a> NodeTrait<'a> for TsCallSignatureDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsConditionalType<'a>

source§

impl<'a> NodeTrait<'a> for TsConstAssertion<'a>

source§

impl<'a> NodeTrait<'a> for TsConstructSignatureDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsConstructorType<'a>

source§

impl<'a> NodeTrait<'a> for TsEnumDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsEnumMember<'a>

source§

impl<'a> NodeTrait<'a> for TsExportAssignment<'a>

source§

impl<'a> NodeTrait<'a> for TsExprWithTypeArgs<'a>

source§

impl<'a> NodeTrait<'a> for TsExternalModuleRef<'a>

source§

impl<'a> NodeTrait<'a> for TsFnType<'a>

source§

impl<'a> NodeTrait<'a> for TsGetterSignature<'a>

source§

impl<'a> NodeTrait<'a> for TsImportEqualsDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsImportType<'a>

source§

impl<'a> NodeTrait<'a> for TsIndexSignature<'a>

source§

impl<'a> NodeTrait<'a> for TsIndexedAccessType<'a>

source§

impl<'a> NodeTrait<'a> for TsInferType<'a>

source§

impl<'a> NodeTrait<'a> for TsInstantiation<'a>

source§

impl<'a> NodeTrait<'a> for TsInterfaceBody<'a>

source§

impl<'a> NodeTrait<'a> for TsInterfaceDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsIntersectionType<'a>

source§

impl<'a> NodeTrait<'a> for TsKeywordType<'a>

source§

impl<'a> NodeTrait<'a> for TsLitType<'a>

source§

impl<'a> NodeTrait<'a> for TsMappedType<'a>

source§

impl<'a> NodeTrait<'a> for TsMethodSignature<'a>

source§

impl<'a> NodeTrait<'a> for TsModuleBlock<'a>

source§

impl<'a> NodeTrait<'a> for TsModuleDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsNamespaceDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsNamespaceExportDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsNonNullExpr<'a>

source§

impl<'a> NodeTrait<'a> for TsOptionalType<'a>

source§

impl<'a> NodeTrait<'a> for TsParamProp<'a>

source§

impl<'a> NodeTrait<'a> for TsParenthesizedType<'a>

source§

impl<'a> NodeTrait<'a> for TsPropertySignature<'a>

source§

impl<'a> NodeTrait<'a> for TsQualifiedName<'a>

source§

impl<'a> NodeTrait<'a> for TsRestType<'a>

source§

impl<'a> NodeTrait<'a> for TsSatisfiesExpr<'a>

source§

impl<'a> NodeTrait<'a> for TsSetterSignature<'a>

source§

impl<'a> NodeTrait<'a> for TsThisType<'a>

source§

impl<'a> NodeTrait<'a> for TsTplLitType<'a>

source§

impl<'a> NodeTrait<'a> for TsTupleElement<'a>

source§

impl<'a> NodeTrait<'a> for TsTupleType<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeAliasDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeAnn<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeAssertion<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeLit<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeOperator<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeParam<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeParamDecl<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeParamInstantiation<'a>

source§

impl<'a> NodeTrait<'a> for TsTypePredicate<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeQuery<'a>

source§

impl<'a> NodeTrait<'a> for TsTypeRef<'a>

source§

impl<'a> NodeTrait<'a> for TsUnionType<'a>

source§

impl<'a> NodeTrait<'a> for UnaryExpr<'a>

source§

impl<'a> NodeTrait<'a> for UpdateExpr<'a>

source§

impl<'a> NodeTrait<'a> for UsingDecl<'a>

source§

impl<'a> NodeTrait<'a> for VarDecl<'a>

source§

impl<'a> NodeTrait<'a> for VarDeclarator<'a>

source§

impl<'a> NodeTrait<'a> for WhileStmt<'a>

source§

impl<'a> NodeTrait<'a> for WithStmt<'a>

source§

impl<'a> NodeTrait<'a> for YieldExpr<'a>