Expand description
§azcache
Unified cache backend for Redis and Memcached.
This crate provides a common interface for interacting with different cache backends, allowing you to switch between implementations without changing your application code.
§Example
use azcache::{CacheBackend, CacheError, CacheResult};
struct MyCache;
impl CacheBackend for MyCache {
fn get(&self, key: &str) -> CacheResult<Option<Vec<u8>>> {
// Your implementation here
Ok(None)
}
fn set(&self, key: &str, value: &[u8], ttl_seconds: Option<u64>) -> CacheResult<()> {
// Your implementation here
Ok(())
}
fn delete(&self, key: &str) -> CacheResult<bool> {
// Your implementation here
Ok(false)
}
fn exists(&self, key: &str) -> CacheResult<bool> {
// Your implementation here
Ok(false)
}
}Enums§
- Cache
Error - Error type for cache operations.
Traits§
- Cache
Backend - Trait defining the interface for cache backends.
Type Aliases§
- Cache
Result - Result type for cache operations.