pub trait ExecutionBackend:
Journal
+ Send
+ Sync
+ Sealed {
// Required methods
fn capabilities(&self) -> BackendCapabilities;
fn lookup_committed_result(
&self,
id: ExecutionId,
idem_key: IdempotencyKey,
) -> impl Future<Output = Result<Option<JournalEntry>, DurableError>> + Send;
}Expand description
A durable-execution persistence backend.
ExecutionBackend is the closed set of journal engines Zeph ships. It is sealed via
[crate::sealed::Sealed]: external crates cannot implement it and must dispatch through
DurableBackendEnum. Every backend is also a Journal, so the append/read/finalize/prune
surface is available uniformly.
§Contract for implementors
capabilitiesMUST return a stable description of the backend; callers cache it and adapt their journaling strategy to it.- The
Journalhalf MUST serialize writes through a single connection so appends receive a monotonicJournalSeq.
Additional entry points (execution open, promise resolution, timer scan) are added as the higher layers land; because the trait is sealed, those additions do not break callers.
Required Methods§
Sourcefn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
Return this backend’s stable capability description.
Sourcefn lookup_committed_result(
&self,
id: ExecutionId,
idem_key: IdempotencyKey,
) -> impl Future<Output = Result<Option<JournalEntry>, DurableError>> + Send
fn lookup_committed_result( &self, id: ExecutionId, idem_key: IdempotencyKey, ) -> impl Future<Output = Result<Option<JournalEntry>, DurableError>> + Send
Look up a committed StepResult anywhere in an execution by its IdempotencyKey.
This is the point-lookup behind INV-13: after a DurableError::ReplayDivergence the
execution restarts fresh, but a guarded effect that already committed its result must not
re-fire. Before invoking a guarded operation the durable step consults this lookup; a Some
result means the effect already succeeded and its journaled value is returned instead. The
key uniquely locates the row via the idx_durable_journal_idem_key index, so the lookup is
O(log n).
§Errors
Returns DurableError::Decode if the located row cannot be reconstructed, or
DurableError::Storage if the query fails.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".