pub enum TypeShape {
Void,
Node,
String,
Custom(Symbol),
Struct(BTreeMap<Symbol, FieldInfo>),
Enum(BTreeMap<Symbol, TypeId>),
Array {
element: TypeId,
non_empty: bool,
},
Optional(TypeId),
Ref(DefId),
}Expand description
The shape of an inferred type, determining its structure.
This represents the inference-time type representation which carries
actual data (fields, variants, inner types). Distinct from
type_system::TypeKind which is the bytecode format discriminant.
Variants§
Void
Produces nothing, transparent to parent scope.
Node
A tree-sitter node.
String
Extracted text from a node.
Custom(Symbol)
User-specified type via @x :: TypeName.
Struct(BTreeMap<Symbol, FieldInfo>)
Object with named fields.
Enum(BTreeMap<Symbol, TypeId>)
Tagged union from labeled alternations.
Array
Array type with element type.
Optional(TypeId)
Optional wrapper.
Ref(DefId)
Forward reference to a recursive type.
Implementations§
Trait Implementations§
impl Eq for TypeShape
impl StructuralPartialEq for TypeShape
Auto Trait Implementations§
impl Freeze for TypeShape
impl RefUnwindSafe for TypeShape
impl Send for TypeShape
impl Sync for TypeShape
impl Unpin for TypeShape
impl UnwindSafe for TypeShape
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.