[][src]Struct rustc_span::def_id::DefId

pub struct DefId {
    pub krate: CrateNum,
    pub index: DefIndex,
}

A DefId identifies a particular definition, by combining a crate index and a def index.

You can create a DefId from a LocalDefId using local_def_id.to_def_id().

Fields

krate: CrateNumindex: DefIndex

Implementations

impl DefId[src]

pub fn local(index: DefIndex) -> DefId[src]

Makes a local DefId from the given DefIndex.

pub fn is_local(self) -> bool[src]

pub fn as_local(self) -> Option<LocalDefId>[src]

pub fn expect_local(self) -> LocalDefId[src]

pub fn is_top_level_module(self) -> bool[src]

Trait Implementations

impl Clone for DefId[src]

impl Copy for DefId[src]

impl Debug for DefId[src]

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

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

impl Eq for DefId[src]

impl Hash for DefId[src]

impl<CTX: HashStableContext> HashStable<CTX> for DefId[src]

impl Ord for DefId[src]

impl PartialEq<DefId> for DefId[src]

impl PartialOrd<DefId> for DefId[src]

impl StructuralEq for DefId[src]

impl StructuralPartialEq for DefId[src]

Auto Trait Implementations

impl RefUnwindSafe for DefId

impl Send for DefId

impl Sync for DefId

impl Unpin for DefId

impl UnwindSafe for DefId

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.