Skip to main content

StoreError

Enum StoreError 

Source
pub enum StoreError<K, V> {
    DuplicatedKey {
        key: K,
        value_previous: V,
        value_updated: V,
    },
    KeyOutOfSync {
        key: K,
        value_previous: V,
        value_updated: V,
    },
    Backend {
        key: K,
        error: String,
    },
}
Expand description

Error related to a Store.

Variants§

§

DuplicatedKey

This process already stored a different value under that key: the same function was computed twice with disagreeing results.

Fields

§key: K
§value_previous: V
§value_updated: V
§

KeyOutOfSync

The durable entry was written by someone else — another process sharing the cache root, or a bundle import — before this insert reached it. Benign: the two values are equally valid and the stored one stays.

Fields

§key: K
§value_previous: V
§value_updated: V
§

Backend

The storage backend refused the write, so the entry is not durable and will be recomputed on the next run.

Fields

§key: K
§error: String

Implementations§

Source§

impl<K, V> StoreError<K, V>

Source

pub fn reason(&self) -> &str

Why the write failed, without the key or the value.

Display renders both, which is right for small entries and wrong for a compiled kernel: those values are megabytes of binary, and a log line must not carry one. Callers storing large values report this instead.

Trait Implementations§

Source§

impl<K: Debug, V: Debug> Debug for StoreError<K, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: Debug, V: Debug> Display for StoreError<K, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: Debug, V: Debug> Error for StoreError<K, V>

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl<K, V> Freeze for StoreError<K, V>
where K: Freeze, V: Freeze,

§

impl<K, V> RefUnwindSafe for StoreError<K, V>

§

impl<K, V> Send for StoreError<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for StoreError<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for StoreError<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnsafeUnpin for StoreError<K, V>
where K: UnsafeUnpin, V: UnsafeUnpin,

§

impl<K, V> UnwindSafe for StoreError<K, V>
where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.