pub enum CacheMode {
Default,
KeepHot,
MakeCold,
EvictLn,
EvictBin,
Unchanged,
}Expand description
Cache mode for database operations.
Specifies how records are cached during database operations. Allows applications to optimize caching behavior based on access patterns.
Variants§
Default
Use the default caching behavior.
Records are cached normally according to the LRU policy.
KeepHot
Keep the record in cache.
The record is pinned in cache and will not be evicted by the LRU policy. Use for hot data that should remain cached.
MakeCold
Make the record most recently used.
Moves the record to the MRU position in the LRU list, making it less likely to be evicted. This is the default for most operations.
EvictLn
Evict the record after the operation.
The record is immediately evicted from cache after the operation completes. Use for one-time access patterns or bulk operations.
EvictBin
Evict both the record and its parent BIN.
More aggressive eviction that also removes the BIN node from cache. Use for sequential scans where data won’t be accessed again.
Unchanged
Do not modify the cache position.
The record is accessed but its position in the LRU list is not changed. Use when you don’t want to affect normal cache management.
Implementations§
Source§impl CacheMode
impl CacheMode
Sourcepub fn evicts_bin(&self) -> bool
pub fn evicts_bin(&self) -> bool
Returns whether this mode evicts the BIN.
Sourcepub fn modifies_cache(&self) -> bool
pub fn modifies_cache(&self) -> bool
Returns whether this mode modifies cache position.
Trait Implementations§
impl Copy for CacheMode
impl Eq for CacheMode
impl StructuralPartialEq for CacheMode
Auto Trait Implementations§
impl Freeze for CacheMode
impl RefUnwindSafe for CacheMode
impl Send for CacheMode
impl Sync for CacheMode
impl Unpin for CacheMode
impl UnsafeUnpin for CacheMode
impl UnwindSafe for CacheMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.