Enum lru_mem::MutateError
source · pub enum MutateError<K, V> {
EntryTooLarge {
key: K,
value: V,
old_entry_size: usize,
new_entry_size: usize,
max_size: usize,
},
}
Expand description
An enumeration of the different errors that can occur when calling LruCache::mutate.
Variants§
EntryTooLarge
Fields
§
key: K
The key of the mutated entry.
§
value: V
The mutated value.
This error is raised if the memory requirement of an entry is raised above the maximum capacity of the cache in a mutation.
Trait Implementations§
source§impl<K: Clone, V: Clone> Clone for MutateError<K, V>
impl<K: Clone, V: Clone> Clone for MutateError<K, V>
source§fn clone(&self) -> MutateError<K, V>
fn clone(&self) -> MutateError<K, V>
Returns a copy 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 MutateError<K, V>
impl<K, V> Display for MutateError<K, V>
source§impl<K: Debug, V: Debug> Error for MutateError<K, V>
impl<K: Debug, V: Debug> Error for MutateError<K, V>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl<K: PartialEq, V: PartialEq> PartialEq<MutateError<K, V>> for MutateError<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq<MutateError<K, V>> for MutateError<K, V>
source§fn eq(&self, other: &MutateError<K, V>) -> bool
fn eq(&self, other: &MutateError<K, V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<K: Eq, V: Eq> Eq for MutateError<K, V>
impl<K, V> StructuralEq for MutateError<K, V>
impl<K, V> StructuralPartialEq for MutateError<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for MutateError<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<K, V> Send for MutateError<K, V>where K: Send, V: Send,
impl<K, V> Sync for MutateError<K, V>where K: Sync, V: Sync,
impl<K, V> Unpin for MutateError<K, V>where K: Unpin, V: Unpin,
impl<K, V> UnwindSafe for MutateError<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> 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