[−][src]Struct chunky::MultiArena
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 MultiArena
[src]
pub fn new(
ident: Ident,
typical_chunk_size: usize,
base_size: usize,
storage: Rc<dyn ChunkStorage>
) -> Self
[src]
ident: Ident,
typical_chunk_size: usize,
base_size: usize,
storage: Rc<dyn ChunkStorage>
) -> 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]
Get the index of the Bin which stores items of size size
pub fn at(&self, index: MultiArenaIndex) -> *const u8
[src]
Get an (untyped) pointer to the item at the given index
pub fn at_mut(&mut self, index: MultiArenaIndex) -> *mut u8
[src]
Get an (untyped) mutable pointer to the item at the given index
pub fn push(&mut self, size: usize) -> (*mut u8, MultiArenaIndex)
[src]
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]
&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]
&'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]
Get the length of the bin of the given bin index
Auto Trait Implementations
impl !Sync for MultiArena
impl !Send for MultiArena
impl Unpin for MultiArena
impl !RefUnwindSafe for MultiArena
impl !UnwindSafe for MultiArena
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,