pub struct LfuConfig {
pub window_capacity_ratio: f64,
pub protected_capacity_ratio: f64,
pub cmsketch_eps: f64,
pub cmsketch_confidence: f64,
}Expand description
w-TinyLFU eviction algorithm config.
Fields§
§window_capacity_ratio: f64window capacity ratio of the total cache capacity.
Must be in (0, 1).
Must guarantee window_capacity_ratio + protected_capacity_ratio < 1.
protected_capacity_ratio: f64protected capacity ratio of the total cache capacity.
Must be in (0, 1).
Must guarantee window_capacity_ratio + protected_capacity_ratio < 1.
cmsketch_eps: f64Error of the count-min sketch.
See CMSketchU16::new.
cmsketch_confidence: f64Confidence of the count-min sketch.
See CMSketchU16::new.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LfuConfig
impl<'de> Deserialize<'de> for LfuConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<LfuConfig> for EvictionConfig
impl From<LfuConfig> for EvictionConfig
source§fn from(value: LfuConfig) -> EvictionConfig
fn from(value: LfuConfig) -> EvictionConfig
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LfuConfig
impl RefUnwindSafe for LfuConfig
impl Send for LfuConfig
impl Sync for LfuConfig
impl Unpin for LfuConfig
impl UnwindSafe for LfuConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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