Struct freqache::LFUCache

source ·
pub struct LFUCache<K, V> { /* private fields */ }
Expand description

A hash set whose keys are ordered by frequency of access

Implementations§

Construct a new LFUCache.

Return true if the cache contains the given key.

Increase the given key’s priority and return true if present, otherwise false.

Add a new value to the cache, and return the old value at key, if any.

Return true if the cache is empty.

Iterate over the keys in the cache, beginning with the least-frequently used.

Return the number of entries in this cache.

Remove and return the last element in the cache, if any.

Remove the given key from the cache and return it, if it was present.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.