pub struct MappedVec<T> { /* private fields */ }
Expand description
See the crate-level documentation for the description of this structure, which is all of the public API in this crate, as well as the method documentation for more info.
Implementations§
Source§impl<T> MappedVec<T>
impl<T> MappedVec<T>
Sourcepub fn insert(&mut self, index: usize, value: T)
pub fn insert(&mut self, index: usize, value: T)
This quickly inserts an element into an index of the vector.
Sourcepub fn resize_with<F: Fn() -> T>(&mut self, nl: usize, f: F)
pub fn resize_with<F: Fn() -> T>(&mut self, nl: usize, f: F)
This resizes a vector to a specific size. If the size exceeds the length of the vector, then the remaining elements are filled in by a specified closure.
Sourcepub fn swap_remove(&mut self, index: usize)
pub fn swap_remove(&mut self, index: usize)
This removes an element without caring about ordering.
Sourcepub fn update_vector(&mut self)
pub fn update_vector(&mut self)
This changes the layout of the vector and resets the indices while maintaining the same indexing behavior.
Sourcepub fn extend<I: Iterator<Item = T> + Clone>(&mut self, iterator: I)
pub fn extend<I: Iterator<Item = T> + Clone>(&mut self, iterator: I)
This extends the vector by an iterator.
Sourcepub fn get_mapped(&self) -> Vec<&T>
pub fn get_mapped(&self) -> Vec<&T>
This gets an ordered vector of references to the elements of this vector.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MappedVec<T>
impl<T> RefUnwindSafe for MappedVec<T>where
T: RefUnwindSafe,
impl<T> Send for MappedVec<T>where
T: Send,
impl<T> Sync for MappedVec<T>where
T: Sync,
impl<T> Unpin for MappedVec<T>where
T: Unpin,
impl<T> UnwindSafe for MappedVec<T>where
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