ResizableCache

Trait ResizableCache 

Source
pub trait ResizableCache {
    // Required method
    fn resize(&mut self, cap: usize) -> u64;
}
Expand description

Implement this trait for Cache to support resize.

Required Methods§

Source

fn resize(&mut self, cap: usize) -> u64

Resizes the cache. If the new capacity is smaller than the size of the current cache any entries past the new capacity are discarded.

Returns the number of discarded entries

Implementors§

Source§

impl<K: Hash + Eq, V, E: OnEvictCallback, S: BuildHasher> ResizableCache for RawLRU<K, V, E, S>