[][src]Struct lfu::LFUCache

pub struct LFUCache<K: Hash + Eq, V> { /* fields omitted */ }

Implementations

impl<K: Hash + Eq, V> LFUCache<K, V>[src]

pub fn with_capacity(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 iter(&self) -> LfuIterator<K, 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]

type Output = V

The returned type after indexing.

impl<K: Eq + Hash, V> IntoIterator for LFUCache<K, V>[src]

type Item = (Rc<K>, V)

The type of the elements being iterated over.

type IntoIter = LfuConsumer<K, V>

Which kind of iterator are we turning this into?

impl<'a, K: Hash + Eq, V> IntoIterator for &'a LFUCache<K, V>[src]

type Item = (Rc<K>, &'a V)

The type of the elements being iterated over.

type IntoIter = LfuIterator<'a, K, V>

Which kind of iterator are we turning this into?

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

impl<K, V> !UnwindSafe for LFUCache<K, V>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

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?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.