pub trait CacheBackend: Send + Sync {
// Required methods
fn get(&self, key: &str) -> Option<u32>;
fn set(&self, key: &str, value: u32, ttl: Duration) -> Result<(), String>;
fn incr(&self, key: &str, amount: u32) -> Result<u32, String>;
}Expand description
Trait to abstract any caching backend. This allows you to use Redis, in-memory caches, or any other backend.