pub struct ChunkyVec<T> { /* private fields */ }Expand description
Pin safe vector
An append only vector that never moves the backing store for each element.
Implementations§
Source§impl<T> ChunkyVec<T>
impl<T> ChunkyVec<T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter(&self) -> Iter<'_, T> ⓘ
Returns an iterator that yields shared references to the elements of the bucket vector.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
Returns an iterator that yields exclusive reference to the elements of the bucket vector.
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a shared reference to the element at the given index if any.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns an exclusive reference to the element at the given index if any.
Sourcepub fn push(&mut self, new_value: T)
pub fn push(&mut self, new_value: T)
Pushes a new element onto the bucket vector.
§Note
This operation will never move other elements, reallocates or otherwise invalidate pointers of elements contained by the bucket vector.
pub fn push_get(&mut self, new_value: T) -> &mut T
Trait Implementations§
Source§impl<'a, T> IntoIterator for &'a ChunkyVec<T>
impl<'a, T> IntoIterator for &'a ChunkyVec<T>
Source§impl<'a, T> IntoIterator for &'a mut ChunkyVec<T>
impl<'a, T> IntoIterator for &'a mut ChunkyVec<T>
impl<T> Unpin for ChunkyVec<T>
Auto Trait Implementations§
impl<T> Freeze for ChunkyVec<T>
impl<T> RefUnwindSafe for ChunkyVec<T>where
T: RefUnwindSafe,
impl<T> Send for ChunkyVec<T>where
T: Send,
impl<T> Sync for ChunkyVec<T>where
T: Sync,
impl<T> UnwindSafe for ChunkyVec<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