#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum CacheStrategy {
#[default]
Full,
Lru(usize),
None,
}
impl CacheStrategy {
pub fn validate(&self) -> crate::Result<()> {
match self {
CacheStrategy::Lru(size) if *size == 0 => Err(crate::Error::Config(
"LRU cache size must be greater than 0".into(),
)),
_ => Ok(()),
}
}
}