ChunkyVec

Struct ChunkyVec 

Source
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>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator that yields shared references to the elements of the bucket vector.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that yields exclusive reference to the elements of the bucket vector.

Source

pub fn get(&self, index: usize) -> Option<&T>

Returns a shared reference to the element at the given index if any.

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

Returns an exclusive reference to the element at the given index if any.

Source

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.

Source

pub fn push_get(&mut self, new_value: T) -> &mut T

Trait Implementations§

Source§

impl<T> Default for ChunkyVec<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> Index<usize> for ChunkyVec<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<usize> for ChunkyVec<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, T> IntoIterator for &'a ChunkyVec<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Iter<'a, T>

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut ChunkyVec<T>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> IterMut<'a, T>

Creates an iterator from a value. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.