#[repr(C)]pub struct FieldEntry {
pub owner_def_index: u32,
pub def_index: u32,
pub name_offset: u32,
pub ty: u32,
pub field_idx: u16,
pub vis: u8,
pub flags: u8,
}Expand description
Structured field row for a Struct, Union, or Enum Variant (20 bytes, 4-byte aligned).
Sorted on disk by (owner_def_index, field_idx) so all fields of an ADT or enum variant
form a contiguous slice discoverable via O(log N) binary search.
Fields§
§owner_def_index: u32Local DefEntry index of the owning Struct, Union, or Variant.
def_index: u32Local DefEntry index of this Field (u32::MAX when no DefEntry was emitted).
name_offset: u32Field identifier offset in string_pool ("x", "0", "1", …).
ty: u32Field TyId in ty_entries (in the owning ADT’s generic parameter namespace).
field_idx: u160-based declaration position inside the struct/union/variant.
vis: u8ItemVis (0 = Public, 1 = Crate, 2 = Restricted, 3 = Private).
flags: u8FIELD_FLAG_* bitmask (FIELD_FLAG_TUPLE, FIELD_FLAG_UNSAFE).
Implementations§
Source§impl FieldEntry
impl FieldEntry
pub const fn to_le(self) -> Self
pub const fn from_le(self) -> Self
pub const fn owner_def_index(&self) -> u32
pub const fn def_index_opt(&self) -> Option<u32>
pub const fn ty_id(&self) -> TyId
pub const fn field_idx(&self) -> u16
pub const fn visibility(&self) -> ItemVis
pub const fn is_tuple_field(&self) -> bool
pub const fn is_unsafe(&self) -> bool
Trait Implementations§
Source§impl Clone for FieldEntry
impl Clone for FieldEntry
impl Copy for FieldEntry
Source§impl Debug for FieldEntry
impl Debug for FieldEntry
Source§impl Default for FieldEntry
impl Default for FieldEntry
impl Eq for FieldEntry
Source§impl PartialEq for FieldEntry
impl PartialEq for FieldEntry
impl StructuralPartialEq for FieldEntry
Auto Trait Implementations§
impl Forget for FieldEntry
impl Freeze for FieldEntry
impl Move for FieldEntry
impl RefUnwindSafe for FieldEntry
impl Send for FieldEntry
impl Sync for FieldEntry
impl Unpin for FieldEntry
impl UnsafeUnpin for FieldEntry
impl UnwindSafe for FieldEntry
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