use crate::error::Result;
#[async_trait::async_trait]
pub trait TieredCacheControl: Send + Sync {
async fn get_l1_direct(&self, key: &str) -> Result<Option<Vec<u8>>>;
async fn set_l1_direct(&self, key: &str, value: Vec<u8>, ttl: Option<u64>) -> Result<()>;
async fn delete_l1_direct(&self, key: &str) -> Result<bool>;
async fn get_l2_direct(&self, key: &str) -> Result<Option<Vec<u8>>>;
async fn set_l2_direct(&self, key: &str, value: Vec<u8>, ttl: Option<u64>) -> Result<()>;
async fn delete_l2_direct(&self, key: &str) -> Result<bool>;
async fn promote_to_l1(&self, key: &str) -> Result<bool>;
async fn demote_to_l2(&self, key: &str, ttl: Option<u64>) -> Result<bool>;
async fn evict_all(&self, key: &str) -> Result<bool>;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_tiered_cache_control_exists() {
let _ = std::marker::PhantomData::<dyn TieredCacheControl>;
}
}