Struct slice_pool::SlicePool
[−]
[src]
pub struct SlicePool<T: Send>(_);
A thread-safe interface for allocating chunks in an owned slice.
Methods
impl<T: Send> SlicePool<T>[src]
fn new<Data: Sliceable<T> + 'static>(data: Data) -> Self
Takes ownership of a slice with a chunkable interface
fn allocate(&self, size: usize) -> Option<PoolVal<T>>
Allocates a new chunk in the slice.
fn allocations(&self) -> usize
Returns the number of allocations in the pool.
fn as_ptr(&self) -> *const T
Returns the pointer to the underlying slice.
fn len(&self) -> usize
Returns the size of the underlying slice.