pub struct StaticDualCache<K, V, S = RandomState> {
pub hasher: S,
pub t1: Arc<T1<K, V>>,
pub t2: Arc<T2<K, V>>,
pub cache: Arc<Cache<K, V>>,
pub epoch: Arc<AtomicU32>,
pub worker_states: Arc<[WorkerState]>,
/* private fields */
}Expand description
A synchronous, wait-free read / spin-locked write cache interface.
Serves as the standard no_std fallback when background Daemon processing is undesirable.
Fields§
§hasher: S§t1: Arc<T1<K, V>>§t2: Arc<T2<K, V>>§cache: Arc<Cache<K, V>>§epoch: Arc<AtomicU32>§worker_states: Arc<[WorkerState]>Implementations§
Source§impl<K, V> StaticDualCache<K, V, RandomState>
impl<K, V> StaticDualCache<K, V, RandomState>
Source§impl<K, V, S> StaticDualCache<K, V, S>
impl<K, V, S> StaticDualCache<K, V, S>
pub fn with_hasher(config: Config, hasher: S) -> Self
Sourcepub fn insert(&self, key: K, value: V)
pub fn insert(&self, key: K, value: V)
Insert synchronously acquires the lock and updates the core.
pub fn insert_t1(&self, key: K, value: V)
pub fn remove(&self, key: &K)
pub fn maintenance(&self)
pub fn clear(&self)
Trait Implementations§
impl<K: Send, V: Send, S: Send> Send for StaticDualCache<K, V, S>
impl<K: Sync, V: Sync, S: Sync> Sync for StaticDualCache<K, V, S>
Auto Trait Implementations§
impl<K, V, S = RandomState> !Freeze for StaticDualCache<K, V, S>
impl<K, V, S = RandomState> !RefUnwindSafe for StaticDualCache<K, V, S>
impl<K, V, S> Unpin for StaticDualCache<K, V, S>where
S: Unpin,
impl<K, V, S> UnsafeUnpin for StaticDualCache<K, V, S>where
S: UnsafeUnpin,
impl<K, V, S> UnwindSafe for StaticDualCache<K, V, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more