#[repr(u8)]pub enum TypeKind {
Void = 0,
Node = 1,
String = 2,
Optional = 3,
ArrayZeroOrMore = 4,
ArrayOneOrMore = 5,
Struct = 6,
Enum = 7,
Alias = 8,
}Expand description
Semantic type kinds.
This is the canonical enumeration of all type kinds, including primitives. Primitive types (Void, Node, String) are stored as TypeDefs like any other type.
Variants§
Void = 0
Unit type - used for definitions with no captures.
Node = 1
AST node reference.
String = 2
Text content extracted from node.
Optional = 3
T? - optional wrapper, contains zero or one value.
ArrayZeroOrMore = 4
T* - array of zero or more values.
ArrayOneOrMore = 5
T+ - array of one or more values (non-empty).
Struct = 6
Record with named fields.
Enum = 7
Discriminated union with tagged variants.
Alias = 8
Named reference to another type (e.g., type Foo = Bar).
Implementations§
Source§impl TypeKind
Convenience aliases for bytecode-specific naming (ArrayStar/ArrayPlus).
impl TypeKind
Convenience aliases for bytecode-specific naming (ArrayStar/ArrayPlus).
Sourcepub const ARRAY_STAR: Self = Self::ArrayZeroOrMore
pub const ARRAY_STAR: Self = Self::ArrayZeroOrMore
Alias for ArrayZeroOrMore (T*).
Sourcepub const ARRAY_PLUS: Self = Self::ArrayOneOrMore
pub const ARRAY_PLUS: Self = Self::ArrayOneOrMore
Alias for ArrayOneOrMore (T+).
Source§impl TypeKind
impl TypeKind
Sourcepub fn is_primitive(self) -> bool
pub fn is_primitive(self) -> bool
Whether this is a primitive/builtin type (Void, Node, String).
Sourcepub fn is_wrapper(self) -> bool
pub fn is_wrapper(self) -> bool
Whether this is a wrapper type (Optional, ArrayZeroOrMore, ArrayOneOrMore).
Wrapper types contain a single inner type. Composite types (Struct, Enum) have named members.
Sourcepub fn is_composite(self) -> bool
pub fn is_composite(self) -> bool
Whether this is a composite type (Struct, Enum).
Sourcepub fn array_is_non_empty(self) -> bool
pub fn array_is_non_empty(self) -> bool
For array types, whether the array is non-empty.
Sourcepub fn primitive_name(self) -> Option<&'static str>
pub fn primitive_name(self) -> Option<&'static str>
Get the display name for primitive types.
Trait Implementations§
impl Copy for TypeKind
impl Eq for TypeKind
impl StructuralPartialEq for TypeKind
Auto Trait Implementations§
impl Freeze for TypeKind
impl RefUnwindSafe for TypeKind
impl Send for TypeKind
impl Sync for TypeKind
impl Unpin for TypeKind
impl UnwindSafe for TypeKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.