[−][src]Struct lfu::LFUCache
Implementations
impl<K: Hash + Eq, V> LFUCache<K, V>
[src]
pub fn new(capacity: usize) -> Result<LFUCache<K, V>, &'static str>
[src]
pub fn contains(&self, key: &K) -> bool
[src]
pub fn len(&self) -> usize
[src]
pub fn remove(&mut self, key: K) -> bool
[src]
pub fn get(&mut self, key: &K) -> Option<&V>
[src]
Returns the value associated with the given key (if it still exists) Method marked as mutable because it internally updates the frequency of the accessed key
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
[src]
pub fn set(&mut self, key: K, value: V)
[src]
Trait Implementations
impl<K: Debug + Hash + Eq, V: Debug> Debug for LFUCache<K, V>
[src]
impl<K: Hash + Eq, V> Index<K> for LFUCache<K, V>
[src]
impl<K: Hash + Eq, V> IntoIterator for LFUCache<K, V>
[src]
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for LFUCache<K, V>
impl<K, V> !Send for LFUCache<K, V>
impl<K, V> !Sync for LFUCache<K, V>
impl<K, V> Unpin for LFUCache<K, V> where
V: Unpin,
V: Unpin,
impl<K, V> !UnwindSafe for LFUCache<K, V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,