pub struct TierConfig {
pub name: String,
pub capacity_bytes: usize,
pub access_latency_us: u64,
pub eviction_policy: EvictionPolicy,
pub disk_path: Option<PathBuf>,
pub promotion_threshold: u64,
pub compress: bool,
}Expand description
Configuration for one tier.
Fields§
§name: StringHuman-readable name (e.g. "L1", "L2", "disk").
capacity_bytes: usizeMaximum number of bytes this tier may hold.
access_latency_us: u64Simulated read latency in microseconds (used in future work / profiling).
eviction_policy: EvictionPolicyHow entries are selected for eviction when the tier is full.
disk_path: Option<PathBuf>Optional path to a directory on disk for file-backed storage.
When Some(path), entries evicted from this tier are stored as
individual files under path/<key_hash>. Memory entries act as
an in-memory index; disk is the actual backing store.
promotion_threshold: u64Minimum access frequency before a hit in this tier promotes the entry to the previous (hotter) tier.
A value of 0 means “always promote” (original behaviour).
A value of 3 means the key must have been accessed at least 3 times
in this tier before it is considered hot enough to move up.
compress: boolWhether to compress entry bytes in this tier.
When true, values are compressed with a simple run-length encoder
before being stored and decoded on retrieval. Useful for L2+ tiers to
reduce memory / disk footprint.
Implementations§
Trait Implementations§
Source§impl Clone for TierConfig
impl Clone for TierConfig
Source§fn clone(&self) -> TierConfig
fn clone(&self) -> TierConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more