Struct chunky::Arena[][src]

pub struct Arena<H: Handler> { /* fields omitted */ }

Stores items of a fixed (max) size consecutively in a collection of chunks

Methods

impl<H: Handler> Arena<H>
[src]

Create a new arena given a chunk group identifier, chunk size and (max) item size

Number of elements in the collection

Is the collection empty?

Allocate space for a new item, returns a pointer to where the new item can be written to and the index that the new item will have.

This is handled like this so items of heterogeneous types or sizes less than the fixed item size can be added to the collection.

Remove the last item from the end

Remove the item at index, by swapping it with the last item and then popping, returning the swapped in item (unless empty).

This is a O(1) way of removing an item if the order of items doesn't matter.

Get a pointer to the item at index

Get a mutable pointer to the item at index

Auto Trait Implementations

impl<H> !Send for Arena<H>

impl<H> !Sync for Arena<H>