dualcache_ff/componant/
config.rs1pub trait CachePolicy {
5 type Evict: crate::componant::policy::EvictionPolicy + Default;
6
7 const T2_THRESHOLD: u16;
9 const T1_THRESHOLD: u16;
11 const T0_THRESHOLD: u16;
13
14 const _ASSERT_POWER_OF_TWO: () = {
17 assert!(Self::T2_THRESHOLD.is_power_of_two(), "T2 Threshold must be 2^n");
18 assert!(Self::T1_THRESHOLD.is_power_of_two(), "T1 Threshold must be 2^n");
19 assert!(Self::T0_THRESHOLD.is_power_of_two(), "T0 Threshold must be 2^n");
20 };
21}
22
23pub struct DefaultExponentialPolicy;
25
26impl CachePolicy for DefaultExponentialPolicy {
27 type Evict = crate::componant::policy::DefaultEvictionPolicy;
28
29 const T2_THRESHOLD: u16 = 2; const T1_THRESHOLD: u16 = 16; const T0_THRESHOLD: u16 = 256; }