Node

Trait Node 

Source
pub trait Node: Any {
    // Required methods
    fn initial_position(&self) -> usize;
    fn final_position(&self) -> usize;
    fn children(&self) -> Vec<&dyn Node>;
    fn get_description(&self) -> String;

    // Provided method
    fn comments(&self) -> Option<&CommentGroup> { ... }
}

Required Methodsยง

Source

fn initial_position(&self) -> usize

The position of the first token in the node.

Source

fn final_position(&self) -> usize

The position of the last token in the node, including the last token itself.

This is not necessarily the same as the last token in the nodeโ€™s children.

Source

fn children(&self) -> Vec<&dyn Node>

The children of the node.

This is used for traversing the tree.

Source

fn get_description(&self) -> String

The description of the node.

Provided Methodsยง

Source

fn comments(&self) -> Option<&CommentGroup>

The comments associated with the node.

Implementorsยง

Sourceยง

impl Node for ClassDefinitionMember

Sourceยง

impl Node for Definition

Sourceยง

impl Node for BackedEnumMemberDefinition

Sourceยง

impl Node for BackedEnumTypeDefinition

Sourceยง

impl Node for EnumDefinition

Sourceยง

impl Node for UnitEnumMemberDefinition

Sourceยง

impl Node for MethodBodyDefinition

Sourceยง

impl Node for InterfaceDefinitionMember

Sourceยง

impl Node for ModifierDefinition

Sourceยง

impl Node for PropertyEntryDefinition

Sourceยง

impl Node for FloatingPointTypeDefinition

Sourceยง

impl Node for SignedIntegerTypeDefinition

Sourceยง

impl Node for TypeDefinition

Sourceยง

impl Node for UnsignedIntegerTypeDefinition

Sourceยง

impl Node for UseDefinition

Sourceยง

impl Node for ArgumentExpression

Sourceยง

impl Node for ExitConstructExpression

Sourceยง

impl Node for MatchArmConditionExpression

Sourceยง

impl Node for Expression

Sourceยง

impl Node for Literal

Sourceยง

impl Node for MagicConstant

Sourceยง

impl Node for ArithmeticOperationExpression

Sourceยง

impl Node for ArrayOperationExpression

Sourceยง

impl Node for AssignmentOperationExpression

Sourceยง

impl Node for AsyncOperationExpression

Sourceยง

impl Node for BitwiseOperationExpression

Sourceยง

impl Node for ClassOperationExpression

Sourceยง

impl Node for ClassOperationInitializationClassExpression

Sourceยง

impl Node for CoalesceOperationExpression

Sourceยง

impl Node for ComparisonOperationExpression

Sourceยง

impl Node for ExceptionOperationExpression

Sourceยง

impl Node for FunctionOperationExpression

Sourceยง

impl Node for FunctionalOperationExpression

Sourceยง

impl Node for GeneratorOperationExpression

Sourceยง

impl Node for LogicalOperationExpression

Sourceยง

impl Node for ObjectOperationExpression

Sourceยง

impl Node for RangeOperationExpression

Sourceยง

impl Node for StringOperationExpression

Sourceยง

impl Node for TernaryOperationExpression

Sourceยง

impl Node for TypeOperationExpression

Sourceยง

impl Node for Statement

Sourceยง

impl Node for ForIteratorStatement

Sourceยง

impl Node for ForeachIteratorStatement

Sourceยง

impl Node for ReturnStatement

Sourceยง

impl Node for TryCatchTypeStatement

Sourceยง

impl Node for AttributeDefinition

Sourceยง

impl Node for AttributeGroupDefinition

Sourceยง

impl Node for ClassDefinition

Sourceยง

impl Node for ClassDefinitionBody

Sourceยง

impl Node for ClassDefinitionExtends

Sourceยง

impl Node for ClassDefinitionImplements

Sourceยง

impl Node for ClassishConstantDefinition

Sourceยง

impl Node for ConstantDefinition

Sourceยง

impl Node for BackedEnumBodyDefinition

Sourceยง

impl Node for BackedEnumCaseDefinition

Sourceยง

impl Node for BackedEnumDefinition

Sourceยง

impl Node for EnumImplementsDefinition

Sourceยง

impl Node for UnitEnumBodyDefinition

Sourceยง

impl Node for UnitEnumCaseDefinition

Sourceยง

impl Node for UnitEnumDefinition

Sourceยง

impl Node for FunctionDefinition

Sourceยง

impl Node for FunctionLikeParameterDefaultValueDefinition

Sourceยง

impl Node for FunctionLikeParameterDefinition

Sourceยง

impl Node for FunctionLikeParameterListDefinition

Sourceยง

impl Node for FunctionLikeReturnTypeDefinition

Sourceยง

impl Node for MethodDefinition

Sourceยง

impl Node for MethodParameterDefinition

Sourceยง

impl Node for MethodParameterListDefinition

Sourceยง

impl Node for MethodTypeConstraintDefinition

Sourceยง

impl Node for MethodTypeConstraintGroupDefinition

Sourceยง

impl Node for InterfaceDefinition

Sourceยง

impl Node for InterfaceDefinitionBody

Sourceยง

impl Node for InterfaceDefinitionExtends

Sourceยง

impl Node for ModifierGroupDefinition

Sourceยง

impl Node for NamespaceDefinition

Sourceยง

impl Node for PropertyDefinition

Sourceยง

impl Node for DefinitionTree

Sourceยง

impl Node for TemplateDefinition

Sourceยง

impl Node for TemplateGroupDefinition

Sourceยง

impl Node for TypeTemplateGroupDefinition

Sourceยง

impl Node for TypeAliasDefinition

Sourceยง

impl Node for UseDefinitionSymbolAlias

Sourceยง

impl Node for ArgumentListExpression

Sourceยง

impl Node for ArgumentPlaceholderExpression

Sourceยง

impl Node for DictElementExpression

Sourceยง

impl Node for DictExpression

Sourceยง

impl Node for TupleExpression

Sourceยง

impl Node for VecElementExpression

Sourceยง

impl Node for VecExpression

Sourceยง

impl Node for AnonymousClassExpression

Sourceยง

impl Node for MatchArmExpression

Sourceยง

impl Node for MatchBodyExpression

Sourceยง

impl Node for MatchExpression

Sourceยง

impl Node for AnonymousFunctionExpression

Sourceยง

impl Node for AnonymousFunctionUseClauseExpression

Sourceยง

impl Node for AnonymousFunctionUseClauseVariableExpression

Sourceยง

impl Node for ArrowFunctionExpression

Sourceยง

impl Node for GenericGroupExpression

Sourceยง

impl Node for LiteralFalse

Sourceยง

impl Node for LiteralFloat

Sourceยง

impl Node for LiteralInteger

Sourceยง

impl Node for LiteralNull

Sourceยง

impl Node for LiteralString

Sourceยง

impl Node for LiteralTrue

Sourceยง

impl Node for ParenthesizedExpression

Sourceยง

impl Node for Identifier

Sourceยง

impl Node for TemplatedIdentifier

Sourceยง

impl Node for BlockStatement

Sourceยง

impl Node for IfElseIfStatement

Sourceยง

impl Node for IfElseStatement

Sourceยง

impl Node for IfStatement

Sourceยง

impl Node for UsingAssignmentStatement

Sourceยง

impl Node for UsingIfClauseStatement

Sourceยง

impl Node for UsingStatement

Sourceยง

impl Node for ExpressionStatement

Sourceยง

impl Node for BreakStatement

Sourceยง

impl Node for ContinueStatement

Sourceยง

impl Node for DoWhileStatement

Sourceยง

impl Node for ForStatement

Sourceยง

impl Node for ForeachStatement

Sourceยง

impl Node for WhileStatement

Sourceยง

impl Node for TryCatchBlockStatement

Sourceยง

impl Node for TryFinallyBlockStatement

Sourceยง

impl Node for TryStatement

Sourceยง

impl Node for Keyword

Sourceยง

impl Node for Variable