pub struct LfuMeta {
pub frequency: u64,
}Expand description
Metadata for LFU (Least Frequently Used) cache entries.
LFU tracks access frequency to evict the least frequently accessed items. The frequency counter is incremented on each access.
§Examples
use cache_rs::meta::LfuMeta;
let mut meta = LfuMeta::default();
assert_eq!(meta.frequency, 0);
// Simulate access
meta.frequency += 1;
assert_eq!(meta.frequency, 1);Fields§
§frequency: u64Access frequency count. Incremented each time the entry is accessed.
Implementations§
Trait Implementations§
impl Copy for LfuMeta
impl Eq for LfuMeta
impl StructuralPartialEq for LfuMeta
Auto Trait Implementations§
impl Freeze for LfuMeta
impl RefUnwindSafe for LfuMeta
impl Send for LfuMeta
impl Sync for LfuMeta
impl Unpin for LfuMeta
impl UnwindSafe for LfuMeta
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
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
Compare self to
key and return true if they are equal.