Skip to main content

DefTyEntry

Struct DefTyEntry 

Source
#[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: u32

Local DefEntry index of this definition (sorted primary key).

§ty: u32

TyId in ty_entries (RHS for TyAlias, value type for constants/statics, ADT type for ADTs/variants).

§parent_def_index: u32

Owning Enum DefEntry index for Variant (u32::MAX for non-variants).

§variant_idx: u16

0-based VariantIdx (0..N for Variant, 0 for Struct/Union, u16::MAX otherwise).

§ctor_shape: u8

CtorShape (None = 0, Record = 1, Tuple = 2, Unit = 3).

§flags: u8

DEF_TY_FLAG_* bitmask.

Implementations§

Source§

impl DefTyEntry

Source

pub const fn to_le(self) -> Self

Source

pub const fn from_le(self) -> Self

Source

pub const fn def_index(&self) -> u32

Source

pub const fn ty_id(&self) -> TyId

Source

pub const fn parent_def_index_opt(&self) -> Option<u32>

Source

pub const fn variant_idx_opt(&self) -> Option<u16>

Source

pub const fn ctor_shape(&self) -> CtorShape

Trait Implementations§

Source§

impl Clone for DefTyEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DefTyEntry

Source§

impl Debug for DefTyEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DefTyEntry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for DefTyEntry

Source§

impl PartialEq for DefTyEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DefTyEntry

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.