use std::time::Duration;
pub use ::redis;
pub trait Cache: Send + Sync {
fn set_nx_px(
&self,
key: &[u8],
value: &[u8],
ttl: Duration,
) -> impl Future<Output = anyhow::Result<bool>> + Send;
fn set(
&self,
key: &[u8],
value: &[u8],
ttl: Duration,
) -> impl Future<Output = anyhow::Result<()>> + Send;
fn get(&self, key: &[u8]) -> impl Future<Output = anyhow::Result<Option<Vec<u8>>>> + Send;
fn del(&self, key: &[u8]) -> impl Future<Output = anyhow::Result<()>> + Send;
}
mod local;
mod redis_cache;
mod utils;
pub use local::LocalCache;
pub use redis_cache::RedisCache;
pub use utils::namespaced;
pub mod set;
pub use set::RedisSet;
pub mod mock;
#[cfg(test)]
mod tests;