[−]Struct rustc_ap_rustc_span::def_id::DefIndex
A DefIndex is an index into the hir-map for a crate, identifying a particular definition. It should really be considered an interned shorthand for a particular DefPath.
Methods
impl DefIndex
pub const MAX_AS_U32: u32
pub const MAX: Self
pub fn from_usize(value: usize) -> Self
pub fn from_u32(value: u32) -> Self
pub const fn from_u32_const(value: u32) -> Self
Hacky variant of from_u32
for use in constants.
This version checks the "max" constraint by using an
invalid array dereference.
pub const unsafe fn from_u32_unchecked(value: u32) -> Self
pub fn index(self) -> usize
Extracts the value of this index as an integer.
pub fn as_u32(self) -> u32
Extracts the value of this index as a u32
.
pub fn as_usize(self) -> usize
Extracts the value of this index as a usize
.
Trait Implementations
impl Add<usize> for DefIndex
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: usize) -> Self
impl Clone for DefIndex
fn clone(&self) -> Self
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for DefIndex
impl Debug for DefIndex
impl Decodable for DefIndex
impl Encodable for DefIndex
impl Eq for DefIndex
impl From<DefIndex> for u32
impl From<DefIndex> for usize
impl From<u32> for DefIndex
impl From<usize> for DefIndex
impl Hash for DefIndex
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Idx for DefIndex
fn new(value: usize) -> Self
fn index(self) -> usize
fn increment_by(&mut self, amount: usize)
[src]
fn plus(self, amount: usize) -> Self
[src]
impl Ord for DefIndex
fn cmp(&self, other: &DefIndex) -> Ordering
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<DefIndex> for DefIndex
impl PartialOrd<DefIndex> for DefIndex
fn partial_cmp(&self, other: &DefIndex) -> Option<Ordering>
fn lt(&self, other: &DefIndex) -> bool
fn le(&self, other: &DefIndex) -> bool
fn gt(&self, other: &DefIndex) -> bool
fn ge(&self, other: &DefIndex) -> bool
impl Step for DefIndex
fn steps_between(start: &Self, end: &Self) -> Option<usize>
fn replace_one(&mut self) -> Self
fn replace_zero(&mut self) -> Self
fn add_one(&self) -> Self
fn sub_one(&self) -> Self
fn add_usize(&self, u: usize) -> Option<Self>
fn sub_usize(&self, u: usize) -> Option<Self>
impl StructuralEq for DefIndex
impl StructuralPartialEq for DefIndex
impl UseSpecializedDecodable for DefIndex
[src]
impl UseSpecializedEncodable for DefIndex
[src]
Auto Trait Implementations
impl RefUnwindSafe for DefIndex
impl Send for DefIndex
impl Sync for DefIndex
impl Unpin for DefIndex
impl UnwindSafe for DefIndex
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Decodable for T where
T: UseSpecializedDecodable,
[src]
T: UseSpecializedDecodable,
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized,
[src]
T: UseSpecializedEncodable + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,