pub enum EntryKind {
StepResult {
idempotency_key: IdempotencyKey,
payload: Bytes,
effect: EffectClass,
payload_version: u8,
},
EffectIntent {
idempotency_key: IdempotencyKey,
effect: EffectClass,
hmac: Option<[u8; 32]>,
},
PromiseCreated {
promise_id: PromiseId,
resolver_token_hash: [u8; 32],
hmac: Option<[u8; 32]>,
},
PromiseResolved {
promise_id: PromiseId,
payload: Bytes,
},
TimerArmed {
timer_id: TimerId,
due_at_ms: i64,
hmac: Option<[u8; 32]>,
},
TimerFired {
timer_id: TimerId,
},
Checkpoint {
up_to_step: u32,
snapshot: Bytes,
},
}Expand description
The kind of a single journal entry.
A closed enum: an exhaustive match over its variants is required, which guarantees every
replay-relevant entry shape is handled. Only the variants that genuinely carry data
(StepResult, PromiseResolved, Checkpoint) own a payload/snapshot field; the control
entries hold identifiers and an optional row-level HMAC instead, so an illegal “control entry
with payload” is unrepresentable.
Variants§
StepResult
The committed result of a completed step. The payload is AEAD-sealed
(nonce || ciphertext || tag).
Fields
idempotency_key: IdempotencyKeyDeduplication key for the step’s effect.
effect: EffectClassHow the step’s side effect behaves under replay.
EffectIntent
An intent to run an exactly-once-guarded effect, journaled before the effect fires.
Fields
idempotency_key: IdempotencyKeyDeduplication key for the guarded effect.
effect: EffectClassHow the step’s side effect behaves under replay.
PromiseCreated
Creation of an external-completion promise.
Fields
PromiseResolved
Resolution of a previously-created promise with its sealed result.
Fields
TimerArmed
A durable timer was armed to fire at a persisted instant.
Fields
TimerFired
A previously-armed timer fired.
Checkpoint
A checkpoint fold that compacts the idempotent prefix up to a step.
Implementations§
Source§impl EntryKind
impl EntryKind
Sourcepub fn tag_enum(&self) -> EntryKindTag
pub fn tag_enum(&self) -> EntryKindTag
Return the data-free EntryKindTag discriminator for this entry.
This is the bridge a backend uses to build the PayloadAad for an
entry without exposing the payload to the cipher binding logic.
Sourcepub fn tag(&self) -> &'static str
pub fn tag(&self) -> &'static str
Return the canonical string used in the entry_kind column.
The step_result tag in particular is the predicate of the unique partial index that
enforces “at most one committed result per step”. Delegates to EntryKindTag::as_str so
the column strings have a single source of truth.
Sourcepub fn idempotency_key(&self) -> Option<IdempotencyKey>
pub fn idempotency_key(&self) -> Option<IdempotencyKey>
Return the entry’s IdempotencyKey, for the two step-bearing kinds that carry one.
The replay-divergence guard (INV-3) compares the journaled key of a StepResult /
EffectIntent against the key freshly derived from the replayed descriptor; control and
promise/timer entries have no idempotency key and return None.
Trait Implementations§
impl Eq for EntryKind
impl StructuralPartialEq for EntryKind
Auto Trait Implementations§
impl !Freeze for EntryKind
impl RefUnwindSafe for EntryKind
impl Send for EntryKind
impl Sync for EntryKind
impl Unpin for EntryKind
impl UnsafeUnpin for EntryKind
impl UnwindSafe for EntryKind
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more