use async_trait::async_trait;
use std::time::Duration;
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
pub trait CacheStore: Send + Sync + 'static {
async fn get(&self, namespace: &str, key: &str) -> anyhow::Result<Option<Vec<u8>>>;
async fn set(
&self,
namespace: &str,
key: &str,
value: &[u8],
ttl: Option<Duration>,
) -> anyhow::Result<()>;
async fn delete(&self, namespace: &str, key: &str) -> anyhow::Result<()>;
async fn clear(&self, namespace: &str) -> anyhow::Result<()>;
async fn entry_count(&self, _namespace: &str) -> anyhow::Result<u64> {
Ok(0)
}
}