Struct rustc_hir::hir_id::HirIdVec[−][src]

pub struct HirIdVec<T> {
    map: IndexVec<LocalDefId, IndexVec<ItemLocalId, T>>,
}
Expand description

N.B. This collection is currently unused, but will be used by #72015 and future PRs.

Fields

map: IndexVec<LocalDefId, IndexVec<ItemLocalId, T>>

Implementations

impl<T> HirIdVec<T>[src]

pub fn push_owner(&mut self, id: LocalDefId)[src]

pub fn push(&mut self, id: HirId, value: T)[src]

pub fn push_sparse(&mut self, id: HirId, value: T) where
    T: Default, 
[src]

pub fn get(&self, id: HirId) -> Option<&T>[src]

pub fn get_owner(&self, id: LocalDefId) -> &IndexVec<ItemLocalId, T>[src]

pub fn iter(&self) -> impl Iterator<Item = &T>[src]

pub fn iter_enumerated(&self) -> impl Iterator<Item = (HirId, &T)>[src]

Trait Implementations

impl<T: Clone> Clone for HirIdVec<T>[src]

fn clone(&self) -> HirIdVec<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for HirIdVec<T>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T, __D: Decoder> Decodable<__D> for HirIdVec<T> where
    T: Decodable<__D>, 
[src]

fn decode(__decoder: &mut __D) -> Result<Self, <__D as Decoder>::Error>[src]

impl<T: Default> Default for HirIdVec<T>[src]

fn default() -> HirIdVec<T>[src]

Returns the “default value” for a type. Read more

impl<T, __E: Encoder> Encodable<__E> for HirIdVec<T> where
    T: Encodable<__E>, 
[src]

fn encode(&self, __encoder: &mut __E) -> Result<(), <__E as Encoder>::Error>[src]

impl<T> Index<HirId> for HirIdVec<T>[src]

type Output = T

The returned type after indexing.

fn index(&self, id: HirId) -> &T[src]

Performs the indexing (container[index]) operation. Read more

impl<T> IndexMut<HirId> for HirIdVec<T>[src]

fn index_mut(&mut self, id: HirId) -> &mut T[src]

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations

impl<T> RefUnwindSafe for HirIdVec<T> where
    T: RefUnwindSafe, 

impl<T> Send for HirIdVec<T> where
    T: Send, 

impl<T> Sync for HirIdVec<T> where
    T: Sync, 

impl<T> Unpin for HirIdVec<T> where
    T: Unpin, 

impl<T> UnwindSafe for HirIdVec<T> where
    T: UnwindSafe, 

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.