Skip to main content

Eviction

Trait Eviction 

Source
pub trait Eviction: Send + Sync {
    // Required method
    fn choose(&self, entries: &[Entry], limit: u64) -> Vec<(String, u64)>;
}
Expand description

The eviction policy: given every entry, the cache’s limit and its size, which entries to delete. It decides and never acts — the cache deletes them, skipping any being served.

Required Methods§

Source

fn choose(&self, entries: &[Entry], limit: u64) -> Vec<(String, u64)>

The keys of the entries to delete from entries so the cache fits limit bytes; empty when it already does.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§