[][src]Trait lru_disk_cache::lru_cache::Meter

pub trait Meter<K, V> {
    type Measure: Default + Copy;
    fn measure<Q: ?Sized>(&self, key: &Q, value: &V) -> Self::Measure
    where
        K: Borrow<Q>
; }

A trait for measuring the size of a cache entry.

If you implement this trait, you should use usize as the Measure type, otherwise you will also have to implement CountableMeter.

Associated Types

type Measure: Default + Copy

The type used to store measurements.

Loading content...

Required methods

fn measure<Q: ?Sized>(&self, key: &Q, value: &V) -> Self::Measure where
    K: Borrow<Q>, 

Calculate the size of key and value.

Loading content...

Implementors

impl<K, V> Meter<K, V> for Count[src]

type Measure = ()

Don't store anything, the measurement can be derived from the map.

fn measure<Q: ?Sized>(&self, _: &Q, _: &V) where
    K: Borrow<Q>, 
[src]

Don't actually count anything either.

Loading content...