pub struct BufferPool { /* private fields */ }
Expand description
Buffer pool that manages reusable byte buffers for parsing
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn with_config(config: PoolConfig) -> Self
pub fn with_config(config: PoolConfig) -> Self
Create buffer pool with custom configuration
Sourcepub fn get_buffer(&self, size: BufferSize) -> DomainResult<PooledBuffer>
pub fn get_buffer(&self, size: BufferSize) -> DomainResult<PooledBuffer>
Get buffer of specified size, reusing if available
Sourcepub fn get_buffer_with_capacity(
&self,
min_capacity: usize,
) -> DomainResult<PooledBuffer>
pub fn get_buffer_with_capacity( &self, min_capacity: usize, ) -> DomainResult<PooledBuffer>
Get buffer with at least the specified capacity
Sourcepub fn cleanup(&self) -> DomainResult<CleanupStats>
pub fn cleanup(&self) -> DomainResult<CleanupStats>
Perform cleanup of old unused buffers
Sourcepub fn stats(&self) -> DomainResult<PoolStats>
pub fn stats(&self) -> DomainResult<PoolStats>
Get current pool statistics
Sourcepub fn current_memory_usage(&self) -> DomainResult<usize>
pub fn current_memory_usage(&self) -> DomainResult<usize>
Get current memory usage across all pools
Trait Implementations§
Source§impl Debug for BufferPool
impl Debug for BufferPool
Auto Trait Implementations§
impl Freeze for BufferPool
impl RefUnwindSafe for BufferPool
impl Send for BufferPool
impl Sync for BufferPool
impl Unpin for BufferPool
impl UnwindSafe for BufferPool
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