Struct rustc_ap_rustc_index::vec::IndexVec [−][src]
Fields
raw: Vec<T>
Implementations
impl<I: Idx, T> IndexVec<I, T>
[src]
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]
T: Clone,
pub fn from_elem_n(elem: T, n: usize) -> Self where
T: Clone,
[src]
T: Clone,
pub fn from_fn_n(func: impl FnMut(I) -> T, n: usize) -> Self
[src]
pub fn from_fn_n(func: impl FnMut(I) -> T, n: usize) -> Self
[src]Create an IndexVec
with n
elements, where the value of each
element is the result of func(i)
. (The underlying vector will
be allocated only once, with a capacity of at least n
.)
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]
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]
pub fn into_iter(self) -> IntoIter<T>
[src]
pub fn into_iter_enumerated(self) -> Enumerated<I, IntoIter<T>>
[src]
pub fn iter(&self) -> Iter<'_, T>
[src]
pub fn iter_enumerated(&self) -> Enumerated<I, Iter<'_, T>>
[src]
pub fn indices(&self) -> Map<Range<usize>, IntoIdx<I>>
[src]
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]
&'a mut self,
range: R
) -> impl Iterator<Item = T> + 'a
pub fn drain_enumerated<'a, R: RangeBounds<usize>>(
&'a mut self,
range: R
) -> impl Iterator<Item = (I, T)> + 'a
[src]
&'a mut self,
range: R
) -> impl Iterator<Item = (I, T)> + 'a
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]
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 pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T)
[src]
pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T)
[src]Returns mutable references to three distinct elements or panics otherwise.
pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T>
[src]
pub fn ensure_contains_elem(&mut self, elem: I, fill_value: impl FnMut() -> 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_to_elem(&mut self, elem: I, fill_value: impl FnMut() -> T)
[src]
Trait Implementations
impl<I: Idx, T> Extend<T> for IndexVec<I, T>
[src]
impl<I: Idx, T> Extend<T> for IndexVec<I, T>
[src]fn extend<J: IntoIterator<Item = T>>(&mut self, iter: J)
[src]
fn extend<J: IntoIterator<Item = T>>(&mut self, iter: J)
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: T)
[src]
fn extend_one(&mut self, item: T)
[src]extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl<I: Idx, T> FromIterator<T> for IndexVec<I, T>
[src]
impl<I: Idx, T> FromIterator<T> for IndexVec<I, T>
[src]fn from_iter<J>(iter: J) -> Self where
J: IntoIterator<Item = T>,
[src]
fn from_iter<J>(iter: J) -> Self where
J: IntoIterator<Item = T>,
[src]Creates a value from an iterator. Read more
impl<I: Idx, T> IntoIterator for IndexVec<I, T>
[src]
impl<I: Idx, T> IntoIterator for IndexVec<I, T>
[src]impl<'a, I: Idx, T> IntoIterator for &'a IndexVec<I, T>
[src]
impl<'a, I: Idx, T> IntoIterator for &'a IndexVec<I, T>
[src]impl<'a, I: Idx, T> IntoIterator for &'a mut IndexVec<I, T>
[src]
impl<'a, I: Idx, T> IntoIterator for &'a mut IndexVec<I, T>
[src]impl<I: Eq + Idx, T: Eq> Eq for IndexVec<I, T>
[src]
impl<I: Idx, T> Send for IndexVec<I, T> where
T: Send,
[src]
T: Send,
impl<I: Idx, T> StructuralEq for IndexVec<I, T>
[src]
impl<I: Idx, T> StructuralPartialEq for IndexVec<I, T>
[src]
Auto Trait Implementations
impl<I, T> RefUnwindSafe for IndexVec<I, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Sync for IndexVec<I, T> where
T: Sync,
T: Sync,
impl<I, T> Unpin for IndexVec<I, T> where
T: Unpin,
T: Unpin,
impl<I, T> UnwindSafe for IndexVec<I, T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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