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

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]

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
[src]

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

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

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]

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

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,