pub enum InsertError<K, V> {
EntryTooLarge {
key: K,
value: V,
entry_size: usize,
max_size: usize,
},
}
Expand description
An enumeration of the different errors that can occur when calling LruCache::insert.
Variants§
EntryTooLarge
This error is raised if the amount of memory required to store an entry to be inserted is larger than the maximum of the cache.
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for InsertError<K, V>
impl<K: Clone, V: Clone> Clone for InsertError<K, V>
Source§fn clone(&self) -> InsertError<K, V>
fn clone(&self) -> InsertError<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<K, V> Display for InsertError<K, V>
impl<K, V> Display for InsertError<K, V>
Source§impl<K: Debug, V: Debug> Error for InsertError<K, V>
impl<K: Debug, V: Debug> Error for InsertError<K, V>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl<K: Eq, V: Eq> Eq for InsertError<K, V>
impl<K, V> StructuralPartialEq for InsertError<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for InsertError<K, V>
impl<K, V> RefUnwindSafe for InsertError<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for InsertError<K, V>
impl<K, V> Sync for InsertError<K, V>
impl<K, V> Unpin for InsertError<K, V>
impl<K, V> UnwindSafe for InsertError<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> ValueSize for T
impl<T> ValueSize for T
Source§fn value_size(&self) -> usize
fn value_size(&self) -> usize
The size of this value in bytes, excluding allocated data. Read more
Source§fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usizewhere
T: 'item,
fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usizewhere
T: 'item,
The total sum of the sizes of all values in the given iterator, in
bytes. This is default-implemented by computing ValueSize::value_size
on every element and summing them. For Sized types, a more potentially
efficient implementation using Iterator::count is provided. If you are
implementing this trait manually, it is unlikely to be more efficient to
provide a manual implementation here. Read more
Source§fn value_size_sum_exact_size_iter<'item>(
iterator: impl ExactSizeIterator<Item = &'item T>,
) -> usizewhere
T: 'item,
fn value_size_sum_exact_size_iter<'item>(
iterator: impl ExactSizeIterator<Item = &'item T>,
) -> usizewhere
T: 'item,
The total sum of the sizes of all values in the given
exact-size-iterator, in bytes. This is default-implemented by using
ValueSize::value_size_sum_iter. For Sized types, a usually more
efficient implementation using ExactSizeIterator::len is provided. If
you are implementing this trait manually, it is unlikely to be more
efficient to provide a manual implementation here. Read more