[−][src]Struct hashlink::lru_cache::LruCache
Methods
impl<K: Eq + Hash, V> LruCache<K, V>
[src]
impl<K: Eq + Hash, V, S> LruCache<K, V, S> where
S: BuildHasher,
[src]
S: BuildHasher,
pub fn with_hasher(capacity: usize, hash_builder: S) -> Self
[src]
pub fn contains_key<Q: ?Sized>(&mut self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn insert(&mut self, k: K, v: V) -> Option<V>
[src]
pub fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn entry(&mut self, key: K) -> Entry<K, V, S>
[src]
If the returned entry is vacant, it will always have room to insert a single value. By using the entry API, you can exceed the configured capacity by 1.
pub fn raw_entry(&self) -> RawEntryBuilder<K, V, S>
[src]
pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<K, V, S>
[src]
If the returned entry is vacant, it will always have room to insert a single value. By using the entry API, you can exceed the configured capacity by 1.
pub fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn capacity(&self) -> usize
[src]
pub fn set_capacity(&mut self, capacity: usize)
[src]
pub fn remove_lru(&mut self) -> Option<(K, V)>
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn clear(&mut self)
[src]
ⓘImportant traits for Iter<'a, K, V>pub fn iter(&self) -> Iter<K, V>
[src]
ⓘImportant traits for IterMut<'a, K, V>pub fn iter_mut(&mut self) -> IterMut<K, V>
[src]
ⓘImportant traits for Drain<'a, K, V>pub fn drain(&mut self) -> Drain<K, V>
[src]
Trait Implementations
impl<K: Eq + Hash, V, S: BuildHasher> IntoIterator for LruCache<K, V, S>
[src]
type Item = (K, V)
The type of the elements being iterated over.
type IntoIter = IntoIter<K, V>
Which kind of iterator are we turning this into?
ⓘImportant traits for IntoIter<K, V>fn into_iter(self) -> IntoIter<K, V>
[src]
impl<'a, K: Eq + Hash, V, S: BuildHasher> IntoIterator for &'a LruCache<K, V, S>
[src]
type Item = (&'a K, &'a V)
The type of the elements being iterated over.
type IntoIter = Iter<'a, K, V>
Which kind of iterator are we turning this into?
ⓘImportant traits for Iter<'a, K, V>fn into_iter(self) -> Iter<'a, K, V>
[src]
impl<'a, K: Eq + Hash, V, S: BuildHasher> IntoIterator for &'a mut LruCache<K, V, S>
[src]
type Item = (&'a K, &'a mut V)
The type of the elements being iterated over.
type IntoIter = IterMut<'a, K, V>
Which kind of iterator are we turning this into?
ⓘImportant traits for IterMut<'a, K, V>fn into_iter(self) -> IterMut<'a, K, V>
[src]
impl<K: Eq + Hash, V, S: BuildHasher> Extend<(K, V)> for LruCache<K, V, S>
[src]
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
[src]
impl<K: Hash + Eq + Clone, V: Clone, S: BuildHasher + Clone> Clone for LruCache<K, V, S>
[src]
Auto Trait Implementations
impl<K, V, S> Send for LruCache<K, V, S> where
K: Send,
S: Send,
V: Send,
K: Send,
S: Send,
V: Send,
impl<K, V, S> Unpin for LruCache<K, V, S> where
K: Unpin,
S: Unpin,
V: Unpin,
K: Unpin,
S: Unpin,
V: Unpin,
impl<K, V, S> Sync for LruCache<K, V, S> where
K: Sync,
S: Sync,
V: Sync,
K: Sync,
S: Sync,
V: Sync,
impl<K, V, S> UnwindSafe for LruCache<K, V, S> where
K: RefUnwindSafe,
S: UnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
S: UnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> RefUnwindSafe for LruCache<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &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<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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,