pub trait StorageAccess<K, V>: Send + Sync{
// Required methods
fn get(&self, key: &K) -> Option<V>;
fn put(&self, key: K, value: V);
fn invalidate(&self, key: &K);
fn clear(&self);
// Provided method
fn contains(&self, key: &K) -> bool { ... }
}Expand description
Synchronous key-value cache interface.
K is the key type; V is the value type.
Required Methods§
Sourcefn invalidate(&self, key: &K)
fn invalidate(&self, key: &K)
Removes the entry for key, if present.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".