Skip to main content

FrequencyEstimator

Trait FrequencyEstimator 

Source
pub trait FrequencyEstimator:
    Send
    + Sync
    + Debug {
    // Required methods
    fn observe(&self, hash: Hash);
    fn estimate(&self, hash: Hash) -> u32;
}
Expand description

Decayed frequency estimate shared by admission and eviction.

Required Methods§

Source

fn observe(&self, hash: Hash)

Record one access to hash. The engine calls this on every serve.

Source

fn estimate(&self, hash: Hash) -> u32

The current decayed access count for hash.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§