pub struct MemoryPool { /* private fields */ }Expand description
Memory pool for efficient buffer reuse
Implementations§
Source§impl MemoryPool
impl MemoryPool
Sourcepub fn with_config(config: PoolConfig) -> Arc<Self>
pub fn with_config(config: PoolConfig) -> Arc<Self>
Create a new memory pool with custom configuration
Sourcepub fn acquire(self: &Arc<Self>, size: usize) -> MemoryPoolResult<PooledBuffer>
pub fn acquire(self: &Arc<Self>, size: usize) -> MemoryPoolResult<PooledBuffer>
Acquire a buffer from the pool
Trait Implementations§
Source§impl Clone for MemoryPool
impl Clone for MemoryPool
Auto Trait Implementations§
impl Freeze for MemoryPool
impl !RefUnwindSafe for MemoryPool
impl Send for MemoryPool
impl Sync for MemoryPool
impl Unpin 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