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

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().


krate: CrateNumindex: DefIndex


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]

Returns whether the item is defined in the crate currently being compiled.

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

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.