pub trait CacheAdapterExt: CacheAdapter {
// Provided methods
fn get_or_set<'a, F, Fut>(
&'a self,
key: CacheKey,
ttl: Duration,
compute: F,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'a>>
where F: FnOnce() -> Fut + Send + 'a,
Fut: Future<Output = Result<Vec<u8>>> + Send + 'a { ... }
fn get_or_set_default<'a, F, Fut>(
&'a self,
key: CacheKey,
compute: F,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'a>>
where F: FnOnce() -> Fut + Send + 'a,
Fut: Future<Output = Result<Vec<u8>>> + Send + 'a { ... }
}Expand description
Extension trait providing convenience methods for caching
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.