Skip to main content

EntryKind

Enum EntryKind 

Source
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: IdempotencyKey

Deduplication key for the step’s effect.

§payload: Bytes

Sealed result bytes.

§effect: EffectClass

How the step’s side effect behaves under replay.

§payload_version: u8

Wire-format version discriminator for the sealed payload.

§

EffectIntent

An intent to run an exactly-once-guarded effect, journaled before the effect fires.

Fields

§idempotency_key: IdempotencyKey

Deduplication key for the guarded effect.

§effect: EffectClass

How the step’s side effect behaves under replay.

§hmac: Option<[u8; 32]>

Row-level HMAC for shared-DB / Restate deployments; None for single-user SQLite.

§

PromiseCreated

Creation of an external-completion promise.

Fields

§promise_id: PromiseId

The new promise’s identifier.

§resolver_token_hash: [u8; 32]

BLAKE3 hash of the 32-byte resolver token (the token itself is never journaled).

§hmac: Option<[u8; 32]>

Row-level HMAC for shared-DB / Restate deployments; None for single-user SQLite.

§

PromiseResolved

Resolution of a previously-created promise with its sealed result.

Fields

§promise_id: PromiseId

The resolved promise’s identifier.

§payload: Bytes

Sealed resolution bytes.

§

TimerArmed

A durable timer was armed to fire at a persisted instant.

Fields

§timer_id: TimerId

The armed timer’s identifier.

§due_at_ms: i64

Wake instant, as Unix epoch milliseconds.

§hmac: Option<[u8; 32]>

Row-level HMAC for shared-DB / Restate deployments; None for single-user SQLite.

§

TimerFired

A previously-armed timer fired.

Fields

§timer_id: TimerId

The fired timer’s identifier.

§

Checkpoint

A checkpoint fold that compacts the idempotent prefix up to a step.

Fields

§up_to_step: u32

All steps strictly below this id are folded into the snapshot.

§snapshot: Bytes

Sealed snapshot bytes.

Implementations§

Source§

impl EntryKind

Source

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.

Source

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.

Source

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§

Source§

impl Clone for EntryKind

Source§

fn clone(&self) -> EntryKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EntryKind

Source§

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

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

impl Eq for EntryKind

Source§

impl PartialEq for EntryKind

Source§

fn eq(&self, other: &EntryKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EntryKind

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more