Skip to main content

EvictionPolicy

Trait EvictionPolicy 

Source
pub trait EvictionPolicy:
    Send
    + Sync
    + Debug {
    // Required method
    fn plan(&self, ctx: &EvictionContext<'_>) -> EvictionPlan;
}
Expand description

Decides what the engine releases when the store is over its target.

Required Methods§

Source

fn plan(&self, ctx: &EvictionContext<'_>) -> EvictionPlan

The one sweep-time decision: what leaves, what graduates. A policy that ranks by frequency reads the shared FrequencyEstimator directly — the engine feeds that estimator on every serve. candidates is already stripped of pins and probe-holds by the engine; a deny-listed hash stays a candidate even when pinned (deny wins over pin).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§