[][src]Struct rustc_data_structures::indexed_vec::IndexVec

pub struct IndexVec<I: Idx, T> {
    pub raw: Vec<T>,
    // some fields omitted
}

Fields

raw: Vec<T>

Methods

impl<I: Idx, T> IndexVec<I, T>[src]

pub fn new() -> Self[src]

pub fn from_raw(raw: Vec<T>) -> Self[src]

pub fn with_capacity(capacity: usize) -> Self[src]

pub fn from_elem<S>(elem: T, universe: &IndexVec<I, S>) -> Self where
    T: Clone
[src]

pub fn from_elem_n(elem: T, n: usize) -> Self where
    T: Clone
[src]

pub fn push(&mut self, d: T) -> I[src]

pub fn pop(&mut self) -> Option<T>[src]

pub fn len(&self) -> usize[src]

pub fn next_index(&self) -> I[src]

Gives the next index that will be assigned when push is called.

pub fn is_empty(&self) -> bool[src]

Important traits for IntoIter<T>
pub fn into_iter(self) -> IntoIter<T>[src]

pub fn into_iter_enumerated(self) -> Enumerated<I, IntoIter<T>>[src]

Important traits for Iter<'a, T>
pub fn iter(&self) -> Iter<T>[src]

pub fn iter_enumerated(&self) -> Enumerated<I, Iter<T>>[src]

Important traits for Map<I, F>
pub fn indices(&self) -> Map<Range<usize>, IntoIdx<I>>[src]

Important traits for IterMut<'a, T>
pub fn iter_mut(&mut self) -> IterMut<T>[src]

pub fn iter_enumerated_mut(&mut self) -> Enumerated<I, IterMut<T>>[src]

pub fn drain<'a, R: RangeBounds<usize>>(
    &'a mut self,
    range: R
) -> impl Iterator<Item = T> + 'a
[src]

pub fn drain_enumerated<'a, R: RangeBounds<usize>>(
    &'a mut self,
    range: R
) -> impl Iterator<Item = (I, T)> + 'a
[src]

pub fn last(&self) -> Option<I>[src]

pub fn shrink_to_fit(&mut self)[src]

pub fn swap(&mut self, a: I, b: I)[src]

pub fn truncate(&mut self, a: usize)[src]

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

pub fn get_mut(&mut self, index: I) -> Option<&mut T>[src]

pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T)[src]

Returns mutable references to two distinct elements, a and b. Panics if a == b.

pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T>[src]

impl<I: Idx, T: Clone> IndexVec<I, T>[src]

pub fn ensure_contains_elem(&mut self, elem: I, fill_value: impl FnMut() -> T)[src]

Grows the index vector so that it contains an entry for elem; if that is already true, then has no effect. Otherwise, inserts new values as needed by invoking fill_value.

pub fn resize(&mut self, new_len: usize, value: T)[src]

pub fn resize_to_elem(&mut self, elem: I, fill_value: impl FnMut() -> T)[src]

impl<I: Idx, T: Ord> IndexVec<I, T>[src]

Trait Implementations

impl<I: Idx, T, CTX> HashStable<CTX> for IndexVec<I, T> where
    T: HashStable<CTX>, 
[src]

type LinkIndex = L

impl<I: Clone + Idx, T: Clone> Clone for IndexVec<I, T>[src]

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

Performs copy-assignment from source. Read more

impl<I: Idx, T> Send for IndexVec<I, T> where
    T: Send
[src]

impl<I: Eq + Idx, T: Eq> Eq for IndexVec<I, T>[src]

impl<I: Idx, T> Extend<T> for IndexVec<I, T>[src]

impl<I: PartialEq + Idx, T: PartialEq> PartialEq<IndexVec<I, T>> for IndexVec<I, T>[src]

impl<I: Idx, T> Default for IndexVec<I, T>[src]

impl<I: Idx, T> IntoIterator for IndexVec<I, T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<'a, I: Idx, T> IntoIterator for &'a IndexVec<I, T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

impl<'a, I: Idx, T> IntoIterator for &'a mut IndexVec<I, T>[src]

type Item = &'a mut T

The type of the elements being iterated over.

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

impl<I: Idx, T: Debug> Debug for IndexVec<I, T>[src]

impl<I: Hash + Idx, T: Hash> Hash for IndexVec<I, T>[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<I: Idx, T> Index<I> for IndexVec<I, T>[src]

type Output = T

The returned type after indexing.

impl<I: Idx, T> IndexMut<I> for IndexVec<I, T>[src]

impl<I: Idx, T> FromIterator<T> for IndexVec<I, T>[src]

impl<I: Idx, T: Encodable> Encodable for IndexVec<I, T>[src]

impl<I: Idx, T: Decodable> Decodable for IndexVec<I, T>[src]

Auto Trait Implementations

impl<I, T> Sync for IndexVec<I, T> where
    T: Sync

Blanket Implementations

impl<T> Erased for T[src]

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

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

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

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

type Owned = T

impl<T> From for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<E> SpecializationError for E[src]