Skip to main content

DefEntry

Struct DefEntry 

Source
#[repr(C)]
pub struct DefEntry { pub def_id: u32, pub kind: u8, pub visibility: u8, pub flags: u8, pub _pad: u8, pub name_offset: u32, pub path_offset: u32, pub sig_offset: u32, pub span: Span, }
Expand description

A definition record in the index.

Fields§

§def_id: u32

Crate-unique identifier for this definition

§kind: u8

Kind of definition (DefKind)

§visibility: u8

Visibility (0 = Public, 1 = Crate, 2 = Restricted, 3 = Private)

§flags: u8

Flags (bit 0: is_macro_expansion)

§_pad: u8§name_offset: u32

Short identifier name offset in string pool (e.g. “enter”)

§path_offset: u32

Canonical full path offset in string pool (e.g. “stdx::panic_context::enter”)

§sig_offset: u32

Signature or type string offset in string pool (e.g. “fn(String) -> PanicContext”), or 0

§span: Span

Source span of the definition

Implementations§

Source§

impl DefEntry

Source

pub fn to_le(self) -> Self

Source

pub fn from_le(self) -> Self

Source

pub fn def_id(&self) -> u32

Source

pub fn name_offset(&self) -> u32

Source

pub fn path_offset(&self) -> u32

Source

pub fn sig_offset(&self) -> u32

Source

pub fn span(&self) -> Span

Source

pub fn is_macro_expansion(&self) -> bool

Source

pub fn is_reexport(&self) -> bool

Source

pub const fn item_vis(&self) -> ItemVis

Trait Implementations§

Source§

impl Clone for DefEntry

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 DefEntry

Source§

impl Debug for DefEntry

Source§

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

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

impl Default for DefEntry

Source§

fn default() -> Self

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

impl Eq for DefEntry

Source§

impl PartialEq for DefEntry

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 DefEntry

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.