pub trait CachePolicy {
type Evict: crate::componant::policy::EvictionPolicy + Default;
const T2_THRESHOLD: u16;
const T1_THRESHOLD: u16;
const T0_THRESHOLD: u16;
const _ASSERT_POWER_OF_TWO: () = {
assert!(Self::T2_THRESHOLD.is_power_of_two(), "T2 Threshold must be 2^n");
assert!(Self::T1_THRESHOLD.is_power_of_two(), "T1 Threshold must be 2^n");
assert!(Self::T0_THRESHOLD.is_power_of_two(), "T0 Threshold must be 2^n");
};
}
pub struct DefaultExponentialPolicy;
impl CachePolicy for DefaultExponentialPolicy {
type Evict = crate::componant::policy::DefaultEvictionPolicy;
const T2_THRESHOLD: u16 = 2; const T1_THRESHOLD: u16 = 16; const T0_THRESHOLD: u16 = 256; }