Struct chunky::MultiArena [−][src]
pub struct MultiArena<H: Handler> { /* fields omitted */ }
Based on a collection type for fixed-size items ("Bin"), creates a collection for heterogenously-sized items which will be stored in the most appropriately-sized bin.
All Bins will use children of a main chunker to create their chunks.
Methods
impl<H: Handler> MultiArena<H>
[src]
impl<H: Handler> MultiArena<H>
pub fn new(ident: Ident, typical_chunk_size: usize, base_size: usize) -> Self
[src]
pub fn new(ident: Ident, typical_chunk_size: usize, base_size: usize) -> Self
Create a new MultiArena
collection using Arena
bins and a base size that represents
the smallest expected item size (used as the item size of the smallest-sized bin)
pub fn size_to_index(&self, size: usize) -> usize
[src]
pub fn size_to_index(&self, size: usize) -> usize
Get the index of the Bin which stores items of size size
pub fn at(&self, index: MultiArenaIndex) -> *const u8
[src]
pub fn at(&self, index: MultiArenaIndex) -> *const u8
Get an (untyped) pointer to the item at the given index
pub fn at_mut(&mut self, index: MultiArenaIndex) -> *mut u8
[src]
pub fn at_mut(&mut self, index: MultiArenaIndex) -> *mut u8
Get an (untyped) mutable pointer to the item at the given index
pub fn push(&mut self, size: usize) -> (*mut u8, MultiArenaIndex)
[src]
pub fn push(&mut self, size: usize) -> (*mut u8, MultiArenaIndex)
Add an item to the end of the bin corresponding to its size
pub fn swap_remove_within_bin(
&mut self,
index: MultiArenaIndex
) -> Option<*const u8>
[src]
pub fn swap_remove_within_bin(
&mut self,
index: MultiArenaIndex
) -> Option<*const u8>
Remove the item referenced by index
from its bin by swapping with the bin's last item
pub fn populated_bin_indices_and_lens<'a>(
&'a self
) -> impl Iterator<Item = (usize, usize)> + 'a
[src]
pub fn populated_bin_indices_and_lens<'a>(
&'a self
) -> impl Iterator<Item = (usize, usize)> + 'a
Return indices of bins that actually contain items and their respective lengths
pub fn bin_len(&self, bin_index: usize) -> usize
[src]
pub fn bin_len(&self, bin_index: usize) -> usize
Get the length of the bin of the given bin index
Auto Trait Implementations
impl<H> !Send for MultiArena<H>
impl<H> !Send for MultiArena<H>
impl<H> !Sync for MultiArena<H>
impl<H> !Sync for MultiArena<H>