#[repr(C)]pub struct DefTyEntry {
pub def_index: u32,
pub ty: u32,
pub parent_def_index: u32,
pub variant_idx: u16,
pub ctor_shape: u8,
pub flags: u8,
}Expand description
Structured type/constructor descriptor keyed by def_index (16 bytes, 4-byte aligned).
Covers TyAlias (RHS target TyId), Const/Static/AssocConst (value TyId),
Struct/Union/Enum (identity ADT TyId + CtorShape), and Variant (owning Enum
identity TyId, parent_def_index, variant_idx, and CtorShape).
Sorted on disk by def_index for O(log N) binary search.
Fields§
§def_index: u32Local DefEntry index of this definition (sorted primary key).
ty: u32TyId in ty_entries (RHS for TyAlias, value type for constants/statics, ADT type for ADTs/variants).
parent_def_index: u32Owning Enum DefEntry index for Variant (u32::MAX for non-variants).
variant_idx: u160-based VariantIdx (0..N for Variant, 0 for Struct/Union, u16::MAX otherwise).
ctor_shape: u8CtorShape (None = 0, Record = 1, Tuple = 2, Unit = 3).
flags: u8DEF_TY_FLAG_* bitmask.
Implementations§
Source§impl DefTyEntry
impl DefTyEntry
pub const fn to_le(self) -> Self
pub const fn from_le(self) -> Self
pub const fn def_index(&self) -> u32
pub const fn ty_id(&self) -> TyId
pub const fn parent_def_index_opt(&self) -> Option<u32>
pub const fn variant_idx_opt(&self) -> Option<u16>
pub const fn ctor_shape(&self) -> CtorShape
Trait Implementations§
Source§impl Clone for DefTyEntry
impl Clone for DefTyEntry
impl Copy for DefTyEntry
Source§impl Debug for DefTyEntry
impl Debug for DefTyEntry
Source§impl Default for DefTyEntry
impl Default for DefTyEntry
impl Eq for DefTyEntry
Source§impl PartialEq for DefTyEntry
impl PartialEq for DefTyEntry
impl StructuralPartialEq for DefTyEntry
Auto Trait Implementations§
impl Forget for DefTyEntry
impl Freeze for DefTyEntry
impl Move for DefTyEntry
impl RefUnwindSafe for DefTyEntry
impl Send for DefTyEntry
impl Sync for DefTyEntry
impl Unpin for DefTyEntry
impl UnsafeUnpin for DefTyEntry
impl UnwindSafe for DefTyEntry
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