pub struct LruConfig {
pub counter_bits: BitCount,
pub remove_on_zero: bool,
}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()?,
remove_on_zero: false
};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.
remove_on_zero: boolIf set to true, items that already have a 0 counter value will be removed at scan time.
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