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
sourceimpl<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
please useARCacheBuilder
instead
Use 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
please useARCacheBuilder
instead
Use 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
please useARCacheBuilder
instead
Use ARCacheBuilder instead
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 view_stats(&self) -> CowCellReadTxn<CacheStats>
pub fn view_stats(&self) -> CowCellReadTxn<CacheStats>
View the statistics for this cache. These values are a snapshot of a point in time and may not be accurate at “this exact moment”. You may pin this value for as long as you wish without causing excess memory usage or transaction cleanup issues.
sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset access stats for this cache. This will reset all the hit and include fields, but values related to current cache state are not altered. This can be useful after a bulk import to prevent polution of the stats from that operation.
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.
Trait Implementations
impl<K: Hash + Eq + Ord + Clone + Debug + Sync + Send + 'static, V: Clone + Debug + Sync + Send + 'static> Send for ARCache<K, V>
impl<K: Hash + Eq + Ord + Clone + Debug + Sync + Send + 'static, V: Clone + Debug + Sync + Send + 'static> Sync for ARCache<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for ARCache<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Unpin for ARCache<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for ARCache<K, V> where
K: UnwindSafe + RefUnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more