#[repr(C)]pub struct TyDefEntry {
pub path_hash: u64,
pub path_offset: u32,
pub loc_or_unit: u32,
}Expand description
Interned definition reference for ADTs, traits, and function items in TyArena (16 bytes).
Fields§
§path_hash: u64§path_offset: u32§loc_or_unit: u32Bit 31 == 0 => local_def_idx; Bit 31 == 1 => external unit_key offset in string_pool (masked by 0x7fff_ffff).
Implementations§
Source§impl TyDefEntry
impl TyDefEntry
pub const EXTERN_BIT: u32 = 0x8000_0000
pub const fn local(path_hash: u64, path_offset: u32, local_def_idx: u32) -> Self
pub const fn external( path_hash: u64, path_offset: u32, unit_offset: u32, ) -> Self
pub const fn to_le(self) -> Self
pub const fn from_le(self) -> Self
pub const fn path_hash(&self) -> u64
pub const fn path_offset(&self) -> u32
pub const fn local_def_idx(&self) -> Option<u32>
pub const fn extern_unit_offset(&self) -> Option<u32>
Trait Implementations§
Source§impl Clone for TyDefEntry
impl Clone for TyDefEntry
impl Copy for TyDefEntry
Source§impl Debug for TyDefEntry
impl Debug for TyDefEntry
Source§impl Default for TyDefEntry
impl Default for TyDefEntry
impl Eq for TyDefEntry
Source§impl Hash for TyDefEntry
impl Hash for TyDefEntry
Source§impl PartialEq for TyDefEntry
impl PartialEq for TyDefEntry
impl StructuralPartialEq for TyDefEntry
Auto Trait Implementations§
impl Forget for TyDefEntry
impl Freeze for TyDefEntry
impl Move for TyDefEntry
impl RefUnwindSafe for TyDefEntry
impl Send for TyDefEntry
impl Sync for TyDefEntry
impl Unpin for TyDefEntry
impl UnsafeUnpin for TyDefEntry
impl UnwindSafe for TyDefEntry
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