[][src]Struct rustc_hir::hir_id::ItemLocalId

pub struct ItemLocalId {
    private: u32,

An ItemLocalId uniquely identifies something within a given "item-like"; that is, within a hir::Item, hir::TraitItem, or hir::ImplItem. There is no guarantee that the numerical value of a given ItemLocalId corresponds to the node's position within the owning item in any way, but there is a guarantee that the LocalItemIds within an owner occupy a dense range of integers starting at zero, so a mapping that maps all or most nodes within an "item-like" to something else can be implemented by a Vec instead of a tree or hash map.


private: u32


impl ItemLocalId[src]

pub const MAX_AS_U32: u32[src]

pub const MAX: Self[src]

pub const fn from_usize(value: usize) -> Self[src]

pub const fn from_u32(value: u32) -> Self[src]

pub const unsafe fn from_u32_unchecked(value: u32) -> Self[src]

pub const fn index(self) -> usize[src]

Extracts the value of this index as an integer.

pub const fn as_u32(self) -> u32[src]

Extracts the value of this index as a u32.

pub const fn as_usize(self) -> usize[src]

Extracts the value of this index as a usize.

Trait Implementations

impl Add<usize> for ItemLocalId[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for ItemLocalId[src]

impl Copy for ItemLocalId[src]

impl Debug for ItemLocalId[src]

impl<D: Decoder> Decodable<D> for ItemLocalId[src]

impl<E: Encoder> Encodable<E> for ItemLocalId[src]

impl Eq for ItemLocalId[src]

impl From<u32> for ItemLocalId[src]

impl From<usize> for ItemLocalId[src]

impl Hash for ItemLocalId[src]

impl<CTX> HashStable<CTX> for ItemLocalId[src]

impl Idx for ItemLocalId[src]

impl Ord for ItemLocalId[src]

impl PartialEq<ItemLocalId> for ItemLocalId[src]

impl PartialOrd<ItemLocalId> for ItemLocalId[src]

impl Step for ItemLocalId[src]

impl StructuralEq for ItemLocalId[src]

impl StructuralPartialEq for ItemLocalId[src]

Auto Trait Implementations

impl RefUnwindSafe for ItemLocalId[src]

impl Send for ItemLocalId[src]

impl Sync for ItemLocalId[src]

impl Unpin for ItemLocalId[src]

impl UnwindSafe for ItemLocalId[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.