pub struct BufferPool { /* private fields */ }Expand description
Thread-safe buffer pool with bounded capacity and size categorization
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn with_config(config: PoolConfig) -> Self
pub fn with_config(config: PoolConfig) -> Self
Create a new buffer pool with custom configuration
Sourcepub fn get_buffer(&self, size: BufferSize) -> PooledBuffer<'_>
pub fn get_buffer(&self, size: BufferSize) -> PooledBuffer<'_>
Get a buffer of the specified size category Returns a PooledBuffer that automatically returns to pool when dropped
Sourcepub fn statistics(&self) -> &PoolStatistics
pub fn statistics(&self) -> &PoolStatistics
Get current statistics for monitoring
Sourcepub fn config(&self) -> &PoolConfig
pub fn config(&self) -> &PoolConfig
Get pool configuration
Sourcepub fn pool_sizes(&self) -> (usize, usize, usize)
pub fn pool_sizes(&self) -> (usize, usize, usize)
Get current pool sizes for each category
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more