pub trait CacheAble<P, T, const N: usize> {
// Required methods
fn save(&mut self, params: &[P; N], result: T);
fn fetch(&self, params: &[P; N]) -> Option<&T>;
// Provided methods
fn prepare_generation(&mut self, _generation: u64) { ... }
fn save_scoped(&mut self, _scope_hash: u64, params: &[P; N], result: T) { ... }
fn fetch_scoped(&self, _scope_hash: u64, params: &[P; N]) -> Option<&T> { ... }
}Required Methods§
fn save(&mut self, params: &[P; N], result: T)
fn fetch(&self, params: &[P; N]) -> Option<&T>
Provided Methods§
fn prepare_generation(&mut self, _generation: u64)
fn save_scoped(&mut self, _scope_hash: u64, params: &[P; N], result: T)
fn fetch_scoped(&self, _scope_hash: u64, params: &[P; N]) -> Option<&T>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".