pub enum EvictionPolicy {
LRU,
LFU,
ARC,
Clock,
Fixed,
}Expand description
Eviction policy selection (configurable per deployment)
§Policy Recommendations
- LRU: Sequential inference, time-series models
- LFU: Random access, sparse models
- ARC: Mixed workloads, production deployments
- Clock: Embedded systems with limited CPU
- Fixed: Deterministic embedded, NASA Level A
Variants§
LRU
Least Recently Used (temporal locality) Best for: Sequential inference, time-series models
LFU
Least Frequently Used (frequency locality) Best for: Random access, sparse models
ARC
Adaptive Replacement Cache [Megiddo & Modha 2003] Best for: Mixed workloads, production deployments
Clock
Clock algorithm (efficient approximation of LRU) Best for: Embedded systems with limited CPU
Fixed
No eviction (fixed memory pool) Best for: Deterministic embedded, NASA Level A
Implementations§
Source§impl EvictionPolicy
impl EvictionPolicy
Sourcepub const fn description(&self) -> &'static str
pub const fn description(&self) -> &'static str
Get human-readable description
Sourcepub const fn supports_eviction(&self) -> bool
pub const fn supports_eviction(&self) -> bool
Check if this policy supports eviction
Sourcepub const fn recommended_use_case(&self) -> &'static str
pub const fn recommended_use_case(&self) -> &'static str
Get recommended use case
Trait Implementations§
Source§impl Clone for EvictionPolicy
impl Clone for EvictionPolicy
Source§fn clone(&self) -> EvictionPolicy
fn clone(&self) -> EvictionPolicy
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EvictionPolicy
impl Debug for EvictionPolicy
Source§impl Default for EvictionPolicy
impl Default for EvictionPolicy
Source§fn default() -> EvictionPolicy
fn default() -> EvictionPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for EvictionPolicy
impl PartialEq for EvictionPolicy
impl Copy for EvictionPolicy
impl Eq for EvictionPolicy
impl StructuralPartialEq for EvictionPolicy
Auto Trait Implementations§
impl Freeze for EvictionPolicy
impl RefUnwindSafe for EvictionPolicy
impl Send for EvictionPolicy
impl Sync for EvictionPolicy
impl Unpin for EvictionPolicy
impl UnwindSafe for EvictionPolicy
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more