Skip to main content

ConcurrentCache

Trait ConcurrentCache 

Source
pub trait ConcurrentCache<K, V>: Send + Sync
where K: CacheKey, V: CacheValue,
{ // Required method fn get(&self, key: &K) -> V; }
Expand description

A thread-safe cache that returns a value for any key, fetching on miss.

Required Methods§

Source

fn get(&self, key: &K) -> V

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, V, F, const SHARD_CAP: usize, const SHARDS: usize> ConcurrentCache<K, V> for ConcurrentClockCache<K, V, F, SHARD_CAP, SHARDS>
where K: CacheKey + CacheKeyHash + Send + Sync, V: CacheValue + Send + Sync, F: Fn(&K) -> V + Send + Sync,