pub struct ZerocopyMemoryPool { /* private fields */ }Expand description
Main zero-copy memory pool implementation
Implementations§
Source§impl ZerocopyMemoryPool
impl ZerocopyMemoryPool
Sourcepub fn new(config: ZerocopyPoolConfig) -> Arc<Self>
pub fn new(config: ZerocopyPoolConfig) -> Arc<Self>
Create a new zero-copy memory pool
Sourcepub fn allocate_buffer(self: &Arc<Self>) -> Option<BufferHandle>
pub fn allocate_buffer(self: &Arc<Self>) -> Option<BufferHandle>
Allocate a buffer from the pool
Sourcepub fn get_statistics(&self) -> PoolStatistics
pub fn get_statistics(&self) -> PoolStatistics
Get current pool statistics
Sourcepub fn available_count(&self) -> usize
pub fn available_count(&self) -> usize
Get number of available buffers
Sourcepub fn buffer_count(&self) -> usize
pub fn buffer_count(&self) -> usize
Get total buffer count
Sourcepub const fn buffer_size(&self) -> usize
pub const fn buffer_size(&self) -> usize
Get buffer size
Sourcepub fn total_memory_bytes(&self) -> usize
pub fn total_memory_bytes(&self) -> usize
Get total memory managed by pool
Trait Implementations§
Source§impl Drop for ZerocopyMemoryPool
impl Drop for ZerocopyMemoryPool
impl Send for ZerocopyMemoryPool
impl Sync for ZerocopyMemoryPool
Auto Trait Implementations§
impl !Freeze for ZerocopyMemoryPool
impl !RefUnwindSafe for ZerocopyMemoryPool
impl Unpin for ZerocopyMemoryPool
impl UnwindSafe for ZerocopyMemoryPool
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