pub struct LruConfig {
pub counter_bits: BitCount,
pub aging_strategy: LruAgingStrategy,
pub starting_value: u32,
pub remove_on_zero: bool,
pub increment: u32,
}Expand description
Configuration for the LRU field.
Used to define memory used by the LRU field, also affecting its maximum value.
§Examples
use cuckoo_clock::config::LruConfig;
let ttl_config = LruConfig {
counter_bits: 5.try_into()?,
..Default::default()
};Fields§
§counter_bits: BitCountNumber of bits used to represent the LRU counter. Larger bit counts allow more values to be represented, allowing items to “accumulate” higher use counts, which will take longer to age.
aging_strategy: LruAgingStrategyThe strategy to use when aging LRU counters.
starting_value: u32The starting value for LRU counter to use.
remove_on_zero: boolIf set to true, items that already have a 0 counter value will be removed at scan time.
increment: u32Increment to add to LRU counter on each insert and lookup.
Trait Implementations§
impl Eq for LruConfig
impl StructuralPartialEq for LruConfig
Auto Trait Implementations§
impl Freeze for LruConfig
impl RefUnwindSafe for LruConfig
impl Send for LruConfig
impl Sync for LruConfig
impl Unpin for LruConfig
impl UnsafeUnpin for LruConfig
impl UnwindSafe for LruConfig
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