pub enum TypeKind {
Show 26 variants
I8,
I16,
I32,
I64,
U8,
U16,
U32,
U64,
Isize,
Usize,
F16,
F32,
F64,
Bool,
Unit,
Struct(StructId),
Enum(EnumId),
Array(ArrayTypeId),
PtrConst(PtrConstTypeId),
PtrMut(PtrMutTypeId),
Module(ModuleId),
Error,
Never,
ComptimeType,
ComptimeStr,
ComptimeInt,
}Expand description
The kind of a type - used for pattern matching.
This enum mirrors the structure of the Type enum but is designed for
pattern matching. During the migration to Type(InternedType), code that
pattern matches on types will use ty.kind() to get a TypeKind.
This separation allows incremental migration: all pattern matches can be
updated to use .kind() while Type is still an enum, then Type can be
replaced with Type(InternedType) without breaking existing code.
Variants§
I8
8-bit signed integer
I16
16-bit signed integer
I32
32-bit signed integer
I64
64-bit signed integer
U8
8-bit unsigned integer
U16
16-bit unsigned integer
U32
32-bit unsigned integer
U64
64-bit unsigned integer
Isize
Pointer-sized signed integer
Usize
Pointer-sized unsigned integer
F16
IEEE 754 binary16 (half-precision float)
F32
IEEE 754 binary32 (single-precision float)
F64
IEEE 754 binary64 (double-precision float)
Bool
Boolean
Unit
The unit type (for functions that don’t return a value)
Struct(StructId)
User-defined struct type
Enum(EnumId)
User-defined enum type
Array(ArrayTypeId)
Fixed-size array type: [T; N]
PtrConst(PtrConstTypeId)
Raw pointer to immutable data: ptr const T
PtrMut(PtrMutTypeId)
Raw pointer to mutable data: ptr mut T
Module(ModuleId)
A module type (from @import)
Error
An error type (used during type checking to continue after errors)
Never
The never type - represents computations that don’t return
ComptimeType
The comptime type - the type of types themselves
ComptimeStr
The comptime string type - compile-time only string values
ComptimeInt
The comptime integer type - compile-time only integer values
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].