tiered_cache/config.rs
1use serde::Deserialize;
2
3/// Configuration for the tiered cache system
4#[derive(Clone, Debug, Deserialize)]
5pub struct CacheConfig {
6 /// Vector of tier configurations, ordered from smallest to largest size
7 pub tiers: Vec<TierConfig>,
8 /// Size of the channel used for cache update notifications
9 pub update_channel_size: Option<usize>,
10}
11
12/// Configuration for a single cache tier
13#[derive(Clone, Debug, Deserialize)]
14pub struct TierConfig {
15 /// Maximum total capacity of the tier in bytes
16 pub total_capacity: usize,
17 /// Valid size range for entries in this tier as (min_size, max_size) in bytes
18 pub size_range: (usize, usize),
19}