Skip to main content

Weighter

Trait Weighter 

Source
pub trait Weighter<K, V>:
    Fn(&K, &V) -> usize
    + Send
    + Sync
    + 'static { }
Expand description

The weighter for the in-memory cache.

The weighter is used to calculate the weight of the cache entry.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<K, V, T> Weighter<K, V> for T
where T: Fn(&K, &V) -> usize + Send + Sync + 'static,