Struct rustc_span::def_id::LocalDefId
source · [−]pub struct LocalDefId {
pub local_def_index: DefIndex,
}
Expand description
A LocalDefId
is equivalent to a DefId
with krate == LOCAL_CRATE
. Since
we encode this information in the type, we can ensure at compile time that
no DefId
s from upstream crates get thrown into the mix. There are quite a
few cases where we know that only DefId
s from the local crate are expected;
a DefId
from a different crate would signify a bug somewhere. This
is when LocalDefId
comes in handy.
Fields
local_def_index: DefIndex
Implementations
sourceimpl LocalDefId
impl LocalDefId
Trait Implementations
sourceimpl Clone for LocalDefId
impl Clone for LocalDefId
sourcefn clone(&self) -> LocalDefId
fn clone(&self) -> LocalDefId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LocalDefId
impl Debug for LocalDefId
sourceimpl<D: Decoder> Decodable<D> for LocalDefId
impl<D: Decoder> Decodable<D> for LocalDefId
fn decode(d: &mut D) -> LocalDefId
sourceimpl<E: Encoder> Encodable<E> for LocalDefId
impl<E: Encoder> Encodable<E> for LocalDefId
sourceimpl Hash for LocalDefId
impl Hash for LocalDefId
sourceimpl<CTX: HashStableContext> HashStable<CTX> for LocalDefId
impl<CTX: HashStableContext> HashStable<CTX> for LocalDefId
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
sourceimpl Idx for LocalDefId
impl Idx for LocalDefId
sourceimpl !Ord for LocalDefId
impl !Ord for LocalDefId
sourceimpl PartialEq<LocalDefId> for LocalDefId
impl PartialEq<LocalDefId> for LocalDefId
sourcefn eq(&self, other: &LocalDefId) -> bool
fn eq(&self, other: &LocalDefId) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LocalDefId) -> bool
fn ne(&self, other: &LocalDefId) -> bool
This method tests for !=
.
sourceimpl !PartialOrd<LocalDefId> for LocalDefId
impl !PartialOrd<LocalDefId> for LocalDefId
1.0.0 · sourcefn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<CTX: HashStableContext> ToStableHashKey<CTX> for LocalDefId
impl<CTX: HashStableContext> ToStableHashKey<CTX> for LocalDefId
type KeyType = DefPathHash
fn to_stable_hash_key(&self, hcx: &CTX) -> DefPathHash
impl Copy for LocalDefId
impl Eq for LocalDefId
impl StructuralEq for LocalDefId
impl StructuralPartialEq for LocalDefId
Auto Trait Implementations
impl RefUnwindSafe for LocalDefId
impl Send for LocalDefId
impl Sync for LocalDefId
impl Unpin for LocalDefId
impl UnwindSafe for LocalDefId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes