pub struct PoolConfig {
pub size_classes: HashMap<usize, usize>,
pub memory_limit: usize,
pub compaction_threshold: f64,
pub min_free_buffers: usize,
}Expand description
Configuration for memory pool
Fields§
§size_classes: HashMap<usize, usize>Size classes and their initial capacities
memory_limit: usizeMaximum total memory in pool
compaction_threshold: f64Compaction threshold (fraction of limit)
min_free_buffers: usizeMinimum free buffers before growing
Implementations§
Source§impl PoolConfig
impl PoolConfig
Sourcepub fn with_size_class(self, size: usize, initial_count: usize) -> Self
pub fn with_size_class(self, size: usize, initial_count: usize) -> Self
Add a size class
Sourcepub fn with_memory_limit(self, limit: usize) -> Self
pub fn with_memory_limit(self, limit: usize) -> Self
Set memory limit
Sourcepub fn with_compaction_threshold(self, threshold: f64) -> Self
pub fn with_compaction_threshold(self, threshold: f64) -> Self
Set compaction threshold
Sourcepub fn with_min_free_buffers(self, count: usize) -> Self
pub fn with_min_free_buffers(self, count: usize) -> Self
Set minimum free buffers
Trait Implementations§
Source§impl Clone for PoolConfig
impl Clone for PoolConfig
Source§fn clone(&self) -> PoolConfig
fn clone(&self) -> PoolConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PoolConfig
impl Debug for PoolConfig
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
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