Struct resizing_vec::ResizingVec
source · pub struct ResizingVec<T> { /* private fields */ }Implementations§
source§impl<T> ResizingVec<T>
impl<T> ResizingVec<T>
pub fn new() -> Self
pub fn prefill(capacity: usize) -> Self
sourcepub fn reserved_space(&self) -> usize
pub fn reserved_space(&self) -> usize
Returns the amount of space length the inner vector has.
Creating a fresh ResizingVec and then inserting elements
at index 0 & 2 would result in reserved_space() returning 3
as at position 1 would be an empty value
sourcepub fn filled(&self) -> usize
pub fn filled(&self) -> usize
Returns the amount of active values. filled() <= reserved_space() will always hold true.
pub fn get(&self, idx: usize) -> Option<&T>
pub fn iter(&self) -> impl Iterator<Item = (usize, &T)> + '_
pub fn get_mut(&mut self, idx: usize) -> Option<&mut T>
pub fn remove(&mut self, idx: usize) -> Option<T>
pub fn insert(&mut self, idx: usize, t: T) -> Option<T>
pub fn clear(&mut self)
pub fn resize(&mut self) -> Vec<Position>
Trait Implementations§
source§impl<T: Clone> Clone for ResizingVec<T>
impl<T: Clone> Clone for ResizingVec<T>
source§impl<T: Debug> Debug for ResizingVec<T>
impl<T: Debug> Debug for ResizingVec<T>
source§impl<T> Default for ResizingVec<T>
impl<T> Default for ResizingVec<T>
source§impl<T> Index<usize> for ResizingVec<T>
impl<T> Index<usize> for ResizingVec<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for ResizingVec<T>where
T: RefUnwindSafe,
impl<T> Send for ResizingVec<T>where
T: Send,
impl<T> Sync for ResizingVec<T>where
T: Sync,
impl<T> Unpin for ResizingVec<T>where
T: Unpin,
impl<T> UnwindSafe for ResizingVec<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