[−][src]Trait lru_disk_cache::lru_cache::CountableMeter
A trait to allow the default Count
measurement to not store an
extraneous counter.
Required methods
fn add(&self, current: Self::Measure, amount: Self::Measure) -> Self::Measure
Add amount
to current
and return the sum.
fn sub(&self, current: Self::Measure, amount: Self::Measure) -> Self::Measure
Subtract amount
from current
and return the difference.
fn size(&self, current: Self::Measure) -> Option<u64>
Return current
as a usize
if possible, otherwise return None
.
If this method returns None
the cache will use the number of cache entries as
its size.
Implementors
impl<K, V, T: Meter<K, V>> CountableMeter<K, V> for T where
T: CountableMeterWithMeasure<K, V, <T as Meter<K, V>>::Measure>,
[src]
T: CountableMeterWithMeasure<K, V, <T as Meter<K, V>>::Measure>,
Count
is all no-ops, the number of entries in the map is the size.