pub trait Node: Sealed {
// Required methods
fn start_position(&self) -> Option<Position>;
fn end_position(&self) -> Option<Position>;
fn similar(&self, other: &Self) -> bool
where Self: Sized;
fn tokens(&self) -> Tokens<'_> ⓘ;
// Provided methods
fn range(&self) -> Option<(Position, Position)> { ... }
fn surrounding_trivia(&self) -> (Vec<&Token>, Vec<&Token>) { ... }
}
Expand description
Used to represent nodes such as tokens or function definitions
This trait is sealed and cannot be implemented for types outside of full-moon
Required Methods§
sourcefn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
sourcefn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
Provided Methods§
Implementations on Foreign Types§
Implementors§
impl Node for BinOp
impl Node for Call
impl Node for Expression
impl Node for Field
impl Node for FunctionArgs
impl Node for Index
impl Node for LastStmt
impl Node for Parameter
impl Node for Prefix
impl Node for Stmt
impl Node for Suffix
impl Node for UnOp
impl Node for Var
impl Node for CompoundOp
Available on crate feature
roblox
only.impl Node for GenericParameterInfo
Available on crate feature
roblox
only.impl Node for IndexedTypeInfo
Available on crate feature
roblox
only.impl Node for TypeFieldKey
Available on crate feature
roblox
only.impl Node for TypeInfo
Available on crate feature
roblox
only.impl Node for Goto
Available on crate feature
lua52
only.impl Node for Label
Available on crate feature
lua52
only.impl Node for Attribute
Available on crate feature
lua54
only.impl Node for ContainedSpan
impl Node for Assignment
impl Node for Ast
impl Node for Block
impl Node for Do
impl Node for ElseIf
impl Node for FunctionBody
impl Node for FunctionCall
impl Node for FunctionDeclaration
impl Node for FunctionName
impl Node for GenericFor
impl Node for If
impl Node for LocalAssignment
impl Node for LocalFunction
impl Node for MethodCall
impl Node for NumericFor
impl Node for Repeat
impl Node for Return
impl Node for TableConstructor
impl Node for VarExpression
impl Node for While
impl Node for CompoundAssignment
Available on crate feature
roblox
only.impl Node for ElseIfExpression
Available on crate feature
roblox
only.impl Node for ExportedTypeDeclaration
Available on crate feature
roblox
only.impl Node for GenericDeclaration
Available on crate feature
roblox
only.impl Node for GenericDeclarationParameter
Available on crate feature
roblox
only.impl Node for IfExpression
Available on crate feature
roblox
only.impl Node for InterpolatedString
Available on crate feature
roblox
only.impl Node for InterpolatedStringSegment
Available on crate feature
roblox
only.impl Node for TypeArgument
Available on crate feature
roblox
only.impl Node for TypeAssertion
Available on crate feature
roblox
only.impl Node for TypeDeclaration
Available on crate feature
roblox
only.impl Node for TypeField
Available on crate feature
roblox
only.impl Node for TypeSpecifier
Available on crate feature
roblox
only.