pub enum IdempotencyError {
StoreFull {
capacity: usize,
},
Stale(StaleClaim),
Unavailable {
reason: &'static str,
},
}Expand description
Why a claim could not be taken.
Variants§
StoreFull
Every slot is held by a request that has not finished, and the key is new.
Finished results are evicted oldest-first to make room, so this means the
store is full of work in progress. See CompletedResults::claim.
Stale(StaleClaim)
A claim was presented that no longer holds its key.
The store could not answer, for a reason of its own.
In the in-memory adapter that is a poisoned lock: some other caller’s panic unwound through it, and the state inside is no longer something this process can vouch for. The store refuses rather than guessing, because a wrong answer here means either a side effect that ran twice or a result handed to a caller that did not earn it.
It is a variant of its own rather than a StaleClaim because “your
claim is too late” and “I cannot tell you anything” are different facts,
and a caller can act on the first and only retry on the second.
Trait Implementations§
Source§impl Clone for IdempotencyError
impl Clone for IdempotencyError
Source§impl Debug for IdempotencyError
impl Debug for IdempotencyError
Source§impl Display for IdempotencyError
impl Display for IdempotencyError
impl Eq for IdempotencyError
Source§impl Error for IdempotencyError
impl Error for IdempotencyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<IdempotencyError> for DispatchError
impl From<IdempotencyError> for DispatchError
Source§fn from(error: IdempotencyError) -> Self
fn from(error: IdempotencyError) -> Self
Keeps a poisoned or absent store from reading as an absent claim.