pub struct ARCache<K, V>where
K: Hash + Eq + Ord + Clone + Debug + Sync + Send + 'static,
V: Clone + Debug + Sync + Send + 'static,{ /* private fields */ }
Expand description
A concurrently readable adaptive replacement cache. Operations are performed on the cache via read and write operations.
Implementations§
source§impl<K: Hash + Eq + Ord + Clone + Debug + Sync + Send + 'static, V: Clone + Debug + Sync + Send + 'static> ARCache<K, V>
impl<K: Hash + Eq + Ord + Clone + Debug + Sync + Send + 'static, V: Clone + Debug + Sync + Send + 'static> ARCache<K, V>
sourcepub fn new(
total: usize,
threads: usize,
ex_ro_miss: usize,
ex_rw_miss: usize,
read_cache: bool,
) -> Self
👎Deprecated since 0.2.20: please useARCacheBuilder
instead
pub fn new( total: usize, threads: usize, ex_ro_miss: usize, ex_rw_miss: usize, read_cache: bool, ) -> Self
ARCacheBuilder
insteadUse ARCacheBuilder instead
sourcepub fn new_size(max: usize, read_max: usize) -> Self
👎Deprecated since 0.2.20: please useARCacheBuilder
instead
pub fn new_size(max: usize, read_max: usize) -> Self
ARCacheBuilder
insteadUse ARCacheBuilder instead
sourcepub fn new_size_watermark(max: usize, read_max: usize, watermark: usize) -> Self
👎Deprecated since 0.2.20: please useARCacheBuilder
instead
pub fn new_size_watermark(max: usize, read_max: usize, watermark: usize) -> Self
ARCacheBuilder
insteadUse ARCacheBuilder instead
sourcepub fn read_stats<S>(&self, stats: S) -> ARCacheReadTxn<'_, K, V, S>where
S: ARCacheReadStat + Clone,
pub fn read_stats<S>(&self, stats: S) -> ARCacheReadTxn<'_, K, V, S>where
S: ARCacheReadStat + Clone,
Begin a read operation on the cache. This reader has a thread-local cache for items
that are localled included via insert
, and can communicate back to the main cache
to safely include items.
sourcepub fn read(&self) -> ARCacheReadTxn<'_, K, V, ()>
pub fn read(&self) -> ARCacheReadTxn<'_, K, V, ()>
Begin a read operation on the cache. This reader has a thread-local cache for items
that are localled included via insert
, and can communicate back to the main cache
to safely include items.
sourcepub fn write(&self) -> ARCacheWriteTxn<'_, K, V, ()>
pub fn write(&self) -> ARCacheWriteTxn<'_, K, V, ()>
Begin a write operation on the cache. This writer has a thread-local store for all items that have been included or dirtied in the transactions, items may be removed from this cache (ie deleted, invalidated).
sourcepub fn write_stats<S>(&self, stats: S) -> ARCacheWriteTxn<'_, K, V, S>where
S: ARCacheWriteStat<K>,
pub fn write_stats<S>(&self, stats: S) -> ARCacheWriteTxn<'_, K, V, S>where
S: ARCacheWriteStat<K>,
_
sourcepub fn try_quiesce_stats<S>(&self, stats: S) -> Swhere
S: ARCacheWriteStat<K>,
pub fn try_quiesce_stats<S>(&self, stats: S) -> Swhere
S: ARCacheWriteStat<K>,
If the lock is available, attempt to quiesce the cache’s async channel states. If the lock is currently held, no action is taken.
sourcepub fn try_quiesce(&self)
pub fn try_quiesce(&self)
If the lock is available, attempt to quiesce the cache’s async channel states. If the lock is currently held, no action is taken.