pub trait AstNodeClass {
const CLASS_INDEX: i32;
}Expand description
Implemented by every concrete AST node type — the analog of the
LUAU_RTTI(Class) macro, which expands to static int ClassIndex().
A node class X : Y becomes #[repr(C)] struct X { pub base: Y, ... } plus
impl AstNodeClass for X { const CLASS_INDEX: i32 = ast_rtti_index("X"); }.
Required Associated Constants§
Sourceconst CLASS_INDEX: i32
const CLASS_INDEX: i32
The node’s RTTI id; mirrors T::ClassIndex().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".