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 CompoundOp
Available on crate features
luau or cfxlua only.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 GenericParameterInfo
Available on crate feature
luau only.impl Node for IndexedTypeInfo
Available on crate feature
luau only.impl Node for TypeFieldKey
Available on crate feature
luau only.impl Node for TypeInfo
Available on crate feature
luau only.impl Node for Goto
Available on crate features
lua52 or luajit only.impl Node for Label
Available on crate features
lua52 or luajit only.impl Node for Attribute
Available on crate feature
lua54 only.impl Node for ElseIfExpression
Available on crate feature
luau only.impl Node for ExportedTypeDeclaration
Available on crate feature
luau only.impl Node for ExportedTypeFunction
Available on crate feature
luau only.impl Node for GenericDeclaration
Available on crate feature
luau only.impl Node for GenericDeclarationParameter
Available on crate feature
luau only.impl Node for IfExpression
Available on crate feature
luau only.impl Node for InterpolatedString
Available on crate feature
luau only.impl Node for InterpolatedStringSegment
Available on crate feature
luau only.impl Node for LuauAttribute
Available on crate feature
luau only.impl Node for TypeArgument
Available on crate feature
luau only.impl Node for TypeAssertion
Available on crate feature
luau only.impl Node for TypeDeclaration
Available on crate feature
luau only.impl Node for TypeField
Available on crate feature
luau only.impl Node for TypeFunction
Available on crate feature
luau only.impl Node for TypeInstantiation
Available on crate feature
luau only.impl Node for TypeIntersection
Available on crate feature
luau only.impl Node for TypeSpecifier
Available on crate feature
luau only.impl Node for TypeUnion
Available on crate feature
luau only.impl Node for ContainedSpan
impl Node for AnonymousFunction
impl Node for Assignment
impl Node for Ast
impl Node for Block
impl Node for CompoundAssignment
Available on crate features
luau or cfxlua only.