pub struct ArenaChunkPool { /* private fields */ }Expand description
A pool of pre-allocated byte chunks for arena reuse.
Implementations§
Source§impl ArenaChunkPool
impl ArenaChunkPool
pub fn new(chunk_size: usize, max_pooled: usize) -> Self
Sourcepub fn release(&mut self, chunk: Vec<u8>)
pub fn release(&mut self, chunk: Vec<u8>)
Return a chunk to the pool (or discard if at capacity).
pub fn pooled_count(&self) -> usize
pub fn reused_count(&self) -> u64
pub fn created_count(&self) -> u64
pub fn hit_rate(&self) -> f64
Trait Implementations§
Source§impl Debug for ArenaChunkPool
impl Debug for ArenaChunkPool
Source§impl Default for ArenaChunkPool
impl Default for ArenaChunkPool
Source§fn default() -> ArenaChunkPool
fn default() -> ArenaChunkPool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArenaChunkPool
impl RefUnwindSafe for ArenaChunkPool
impl Send for ArenaChunkPool
impl Sync for ArenaChunkPool
impl Unpin for ArenaChunkPool
impl UnsafeUnpin for ArenaChunkPool
impl UnwindSafe for ArenaChunkPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more