pub trait Cache<T: Clone> {
// Required methods
fn get_or_compute(&self, key: PlainRef, compute: impl FnOnce() -> T) -> T;
fn clear(&self);
}Required Methods§
fn get_or_compute(&self, key: PlainRef, compute: impl FnOnce() -> T) -> T
fn clear(&self)
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.
Implementations on Foreign Types§
Source§impl<T: Clone + ValueSize + Send + 'static> Cache<T> for Arc<SyncCache<PlainRef, T>>
Available on crate feature cache only.
impl<T: Clone + ValueSize + Send + 'static> Cache<T> for Arc<SyncCache<PlainRef, T>>
Available on crate feature
cache only.