Skip to main content

RecordIndex

Trait RecordIndex 

Source
pub trait RecordIndex {
    // Required method
    fn record_for_input(
        &self,
        operation_id: &OperationId,
        input_id: &InputId,
    ) -> Option<KernelRecord>;

    // Provided method
    fn note_committed(&mut self, record: &KernelRecord) { ... }
}
Expand description

Lookup from an input_id to the record it already produced.

This is the durable idempotency anchor of §15.2: a production implementation answers from the journal, so a retry stays idempotent no matter how long the operation has been running. The trait exists so the transaction never holds its own replay window — the moment that window is the authority, a long run turns a legitimate retry into DuplicateInputConflict.

Required Methods§

Source

fn record_for_input( &self, operation_id: &OperationId, input_id: &InputId, ) -> Option<KernelRecord>

The record this input_id already produced in this operation, if any.

Provided Methods§

Source

fn note_committed(&mut self, record: &KernelRecord)

Note a record that just became durable.

A journal-backed index that reads through to storage implements this as a no-op; an index that caches needs it to stay complete. It is called after the host reported a successful CAS append, never before.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§