#[non_exhaustive]pub enum IdempotencyClaim {
Claimed,
Replay(TaskId),
Conflict {
held_by: MessageId,
},
}Expand description
What happened when a store was asked to claim an idempotency key.
See TaskStore::claim_idempotency_key.
#[non_exhaustive] because every out-of-tree TaskStore must match on
this, and the outcomes this can report are not a closed set: an expiry, or
an “in flight, wait” that would let the second caller be told to retry
instead of handed a TaskNotFound, are both plausible fourth variants.
Adding one without the attribute would be a compile break for every
external store — which STABILITY.md §4 promises not to inflict.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Claimed
The key was free. The caller owns it and should create the task.
Replay(TaskId)
The key is already held, by the same message. A genuine retry: return the named task in whatever state it has reached, and execute nothing.
Conflict
The key is already held, by a different message.
Not a retry. Either the caller generated one key for two distinct sends, or two of its concurrent sends collided on a key. Returning the first task here would hand back a result for a message the caller did not just send, and it would act on it — a silent wrong answer, the failure a caller can least detect. It is reported instead.
Trait Implementations§
Source§impl Clone for IdempotencyClaim
impl Clone for IdempotencyClaim
Source§fn clone(&self) -> IdempotencyClaim
fn clone(&self) -> IdempotencyClaim
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IdempotencyClaim
impl Debug for IdempotencyClaim
impl Eq for IdempotencyClaim
Source§impl PartialEq for IdempotencyClaim
impl PartialEq for IdempotencyClaim
impl StructuralPartialEq for IdempotencyClaim
Auto Trait Implementations§
impl Freeze for IdempotencyClaim
impl RefUnwindSafe for IdempotencyClaim
impl Send for IdempotencyClaim
impl Sync for IdempotencyClaim
impl Unpin for IdempotencyClaim
impl UnsafeUnpin for IdempotencyClaim
impl UnwindSafe for IdempotencyClaim
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request