[][src]Struct chunky::Vector

pub struct Vector<Item: Clone> { /* fields omitted */ }

A vector which stores items of a known type in an Arena

Methods

impl<Item: Clone> Vector<Item>[src]

pub fn new(
    ident: Ident,
    chunk_size: usize,
    storage: Rc<dyn ChunkStorage>
) -> Self
[src]

Create a new chunky vector

pub fn len(&self) -> usize[src]

Get the number of elements in the vector

pub fn is_empty(&self) -> bool[src]

Is the chunky vector empty?

pub fn at(&self, index: usize) -> Option<&Item>[src]

Get a reference to the item at index

pub fn at_mut(&mut self, index: usize) -> Option<&mut Item>[src]

Get a mutable reference to the item at index

pub fn push(&mut self, item: Item)[src]

Push an item onto the vector

pub fn pop(&mut self) -> Option<Item>[src]

Remove and return the last item, if the vector wasn't empty

Auto Trait Implementations

impl<Item> !Sync for Vector<Item>

impl<Item> !Send for Vector<Item>

impl<Item> Unpin for Vector<Item> where
    Item: Unpin

impl<Item> !RefUnwindSafe for Vector<Item>

impl<Item> !UnwindSafe for Vector<Item>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]