use std::time::Duration;
use super::{CacheBackend, CacheFuture};
#[derive(Clone, Debug, Default)]
pub struct NullCache;
impl NullCache {
pub fn new() -> Self {
Self
}
}
impl CacheBackend for NullCache {
fn get<'a>(&'a self, _key: &'a str) -> CacheFuture<'a, Option<String>> {
Box::pin(async { Ok(None) })
}
fn set<'a>(&'a self, _key: &'a str, _value: String, _ttl: Duration) -> CacheFuture<'a, ()> {
Box::pin(async { Ok(()) })
}
}