#[repr(transparent)]pub struct IndexVec<I, T> {
pub raw: Vec<T>,
/* private fields */
}Expand description
An owned sequence of T indexed by I
Fields§
§raw: Vec<T>Implementations§
Source§impl<I: Idx, T> IndexVec<I, T>
impl<I: Idx, T> IndexVec<I, T>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn from_raw(raw: Vec<T>) -> Self
pub fn drain<R: RangeBounds<usize>>( &mut self, range: R, ) -> impl Iterator<Item = T> + '_
pub fn truncate(&mut self, a: usize)
pub fn as_slice(&self) -> &IndexSlice<I, T>
pub fn as_mut_slice(&mut self) -> &mut IndexSlice<I, T>
pub fn push(&mut self, data: T) -> I
pub fn next_index(&self) -> I
pub fn shrink_to_fit(&mut self)
pub fn resize(&mut self, new_len: usize, value: T)where
T: Clone,
Methods from Deref<Target = IndexSlice<I, T>>§
pub fn first(&self) -> Option<&T>
pub fn last(&self) -> Option<&T>
pub fn last_mut(&mut self) -> Option<&mut T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, T> ⓘ
Sourcepub fn indices(
&self,
) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + Clone + 'static
pub fn indices( &self, ) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + Clone + 'static
Returns an iterator over the indices
pub fn iter_enumerated( &self, ) -> impl DoubleEndedIterator<Item = (I, &T)> + ExactSizeIterator + '_
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
pub fn iter_mut_enumerated( &mut self, ) -> impl DoubleEndedIterator<Item = (I, &mut T)> + ExactSizeIterator + '_
pub fn last_index(&self) -> Option<I>
pub fn swap(&mut self, a: I, b: I)
pub fn get(&self, index: I) -> Option<&T>
pub fn get_mut(&mut self, index: I) -> Option<&mut T>
pub fn binary_search(&self, value: &T) -> Result<I, I>where
T: Ord,
Trait Implementations§
Source§impl<I: Idx, T> Borrow<IndexSlice<I, T>> for IndexVec<I, T>
impl<I: Idx, T> Borrow<IndexSlice<I, T>> for IndexVec<I, T>
Source§fn borrow(&self) -> &IndexSlice<I, T>
fn borrow(&self) -> &IndexSlice<I, T>
Immutably borrows from an owned value. Read more
Source§impl<I: Idx, T> BorrowMut<IndexSlice<I, T>> for IndexVec<I, T>
impl<I: Idx, T> BorrowMut<IndexSlice<I, T>> for IndexVec<I, T>
Source§fn borrow_mut(&mut self) -> &mut IndexSlice<I, T>
fn borrow_mut(&mut self) -> &mut IndexSlice<I, T>
Mutably borrows from an owned value. Read more
impl<I: Eq, T: Eq> Eq for IndexVec<I, T>
Source§impl<I, T> Extend<T> for IndexVec<I, T>
impl<I, T> Extend<T> for IndexVec<I, T>
Source§fn extend<Iter: IntoIterator<Item = T>>(&mut self, iter: Iter)
fn extend<Iter: IntoIterator<Item = T>>(&mut self, iter: Iter)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<I: Idx, T> FromIterator<T> for IndexVec<I, T>
impl<I: Idx, T> FromIterator<T> for IndexVec<I, T>
Source§fn from_iter<Iter: IntoIterator<Item = T>>(iter: Iter) -> Self
fn from_iter<Iter: IntoIterator<Item = T>>(iter: Iter) -> Self
Creates a value from an iterator. Read more
Source§impl<I: GetSize, T: GetSize> GetSize for IndexVec<I, T>
impl<I: GetSize, T: GetSize> GetSize for IndexVec<I, T>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)
fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
Determines how many bytes this object occupies inside the heap while using a
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines the total size of the object while using a
tracker. Read moreSource§impl<I: Idx, T> IntoIterator for IndexVec<I, T>
impl<I: Idx, T> IntoIterator for IndexVec<I, T>
Source§impl<'a, I: Idx, T> IntoIterator for &'a IndexVec<I, T>
impl<'a, I: Idx, T> IntoIterator for &'a IndexVec<I, T>
Source§impl<'a, I: Idx, T> IntoIterator for &'a mut IndexVec<I, T>
impl<'a, I: Idx, T> IntoIterator for &'a mut IndexVec<I, T>
impl<I: Idx, T> Send for IndexVec<I, T>where
T: Send,
impl<I: PartialEq, T: PartialEq> StructuralPartialEq for IndexVec<I, T>
Auto Trait Implementations§
impl<I, T> Freeze for IndexVec<I, T>
impl<I, T> RefUnwindSafe for IndexVec<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Sync for IndexVec<I, T>
impl<I, T> Unpin for IndexVec<I, T>
impl<I, T> UnsafeUnpin for IndexVec<I, T>
impl<I, T> UnwindSafe for IndexVec<I, T>where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<I, C> CompactStringExt for C
impl<I, C> CompactStringExt for C
Source§fn concat_compact(self) -> CompactString
fn concat_compact(self) -> CompactString
Concatenates all the items of a collection into a
CompactString Read moreSource§fn join_compact<S>(self, separator: S) -> CompactString
fn join_compact<S>(self, separator: S) -> CompactString
Joins all the items of a collection, placing a separator between them, forming a
CompactString Read moreSource§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.