pub enum TypeData {
Struct(StructData),
Enum(EnumData),
Array {
element: InternedType,
len: u64,
},
PtrConst {
pointee: InternedType,
},
PtrMut {
pointee: InternedType,
},
Ref {
referent: InternedType,
},
MutRef {
referent: InternedType,
},
Slice {
element: InternedType,
},
MutSlice {
element: InternedType,
},
Vec {
element: InternedType,
},
}Expand description
Type data stored in the intern pool.
This is NOT Copy - it lives in the pool. You work with InternedType indices.
§Type Categories
- Struct and Enum are nominal types: identity comes from the name
- Array, PtrConst, and PtrMut are structural types: identity comes from element/pointee type
Variants§
Struct(StructData)
User-defined struct (nominal type).
Two structs with the same fields but different names are different types.
Enum(EnumData)
User-defined enum (nominal type).
Two enums with the same variants but different names are different types.
Array
Fixed-size array (structural type).
Arrays with the same element type and length are the same type, regardless of where they were defined.
PtrConst
Raw const pointer (structural type).
ptr const T - pointer to immutable data.
Fields
pointee: InternedTypePtrMut
Raw mut pointer (structural type).
ptr mut T - pointer to mutable data.
Fields
pointee: InternedTypeRef
Immutable reference (structural type, ADR-0062).
Ref(T) - scope-bound non-mutating borrow.
Fields
referent: InternedTypeMutRef
Mutable reference (structural type, ADR-0062).
MutRef(T) - scope-bound exclusive mutating borrow.
Fields
referent: InternedTypeSlice
Immutable slice (structural type, ADR-0064).
Slice(T) - scope-bound fat pointer {ptr, len}.
Fields
element: InternedTypeMutSlice
Mutable slice (structural type, ADR-0064).
MutSlice(T) - scope-bound exclusive fat pointer {ptr, len}.
Fields
element: InternedTypeVec
Owned, growable vector (structural type, ADR-0066).
Vec(T) - heap-allocated {ptr, len, cap}.
Fields
element: InternedTypeTrait Implementations§
Source§impl<'de> Deserialize<'de> for TypeData
impl<'de> Deserialize<'de> for TypeData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TypeData
impl RefUnwindSafe for TypeData
impl Send for TypeData
impl Sync for TypeData
impl Unpin for TypeData
impl UnsafeUnpin for TypeData
impl UnwindSafe for TypeData
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<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].