pub struct MemoryPool { /* private fields */ }Expand description
A simple memory pool for reusing byte buffers to reduce allocations
Implementations§
Source§impl MemoryPool
impl MemoryPool
pub fn new(config: PoolConfig) -> Self
Sourcepub fn get_buffer(&self, min_size: usize) -> PooledBuffer
pub fn get_buffer(&self, min_size: usize) -> PooledBuffer
Get a buffer of appropriate size from the pool
Trait Implementations§
Auto Trait Implementations§
impl Forget for MemoryPool
impl Freeze for MemoryPool
impl Move for MemoryPool
impl RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin for MemoryPool
impl UnsafeUnpin for MemoryPool
impl UnwindSafe for MemoryPool
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