Skip to main content

MemoryEstimator

Trait MemoryEstimator 

Source
pub trait MemoryEstimator: Send + Sync {
    // Required methods
    fn estimate_bytes(&self, items_buffered: usize) -> usize;
    fn name(&self) -> &'static str;
}
Expand description

Trait for estimating memory usage of buffered items

This allows customization of memory estimation if workload characteristics differ from the default conservative 2KB per item assumption.

Required Methods§

Source

fn estimate_bytes(&self, items_buffered: usize) -> usize

Estimate total memory in bytes for given number of buffered items

Source

fn name(&self) -> &'static str

Human-readable name for this estimator (for debugging/logging)

Implementors§