#[non_exhaustive]pub enum DurableBackendEnum {
Local(Arc<LocalBackend>),
}Expand description
Closed enum dispatch over the compiled-in backends.
Construct it from a concrete backend and hand it across the crate boundary behind an Arc;
callers invoke the Journal and ExecutionBackend methods on the enum and the dispatch
resolves to the active variant with a single match. The enum is #[non_exhaustive]: the
feature-gated Restate variant joins it with the restate feature without breaking in-crate
matches.
§Examples
use std::sync::Arc;
use zeph_durable::{BackendCapabilities, DurableBackendEnum};
fn max_payload(backend: &DurableBackendEnum) -> usize {
use zeph_durable::ExecutionBackend as _;
backend.capabilities().max_payload
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Local(Arc<LocalBackend>)
The always-compiled local backend journaling to a dedicated durable.db.
Held behind an Arc so the same backing instance can be shared with the
JournalWriter (which owns the write path) while this enum serves
the read path consumed by the ReplayCursor — both observe one
durable.db pool.
Implementations§
Source§impl DurableBackendEnum
Promise, timer, and retention dispatch.
impl DurableBackendEnum
Promise, timer, and retention dispatch.
These methods back the DurablePromise /
DurableTimerService /
DurableRetentionService surfaces. They
are inherent on the enum rather than on the sealed ExecutionBackend trait because they are
implemented through the local backend’s dedicated durable_promises / durable_timers tables; a
future cross-process backend (Restate) would satisfy the same surface through its own SDK
primitives, so the closed match here gains a new arm at that point — a compile-time prompt
rather than a silent gap.
Sourcepub async fn cancel_execution(
&self,
id: ExecutionId,
) -> Result<CancelOutcome, DurableError>
pub async fn cancel_execution( &self, id: ExecutionId, ) -> Result<CancelOutcome, DurableError>
Cancel a running execution so it is never resumed. See LocalBackend::cancel_execution.
A plain in-process-callable primitive (#6362 trimmed US-002): no CLI or orchestration coupling, just a dispatch to the active backend.
§Errors
Returns any DurableError LocalBackend::cancel_execution can return.
Trait Implementations§
Source§impl Debug for DurableBackendEnum
impl Debug for DurableBackendEnum
Source§impl ExecutionBackend for DurableBackendEnum
impl ExecutionBackend for DurableBackendEnum
Source§fn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
Source§async fn lookup_committed_result(
&self,
id: ExecutionId,
idem_key: IdempotencyKey,
) -> Result<Option<JournalEntry>, DurableError>
async fn lookup_committed_result( &self, id: ExecutionId, idem_key: IdempotencyKey, ) -> Result<Option<JournalEntry>, DurableError>
Source§impl Journal for DurableBackendEnum
impl Journal for DurableBackendEnum
Source§async fn append(&self, entry: JournalEntry) -> Result<JournalSeq, DurableError>
async fn append(&self, entry: JournalEntry) -> Result<JournalSeq, DurableError>
Source§async fn read_execution(
&self,
id: ExecutionId,
) -> Result<Vec<JournalEntry>, DurableError>
async fn read_execution( &self, id: ExecutionId, ) -> Result<Vec<JournalEntry>, DurableError>
Source§async fn read_execution_range(
&self,
id: ExecutionId,
from_step_id: u32,
limit: usize,
) -> Result<Vec<JournalEntry>, DurableError>
async fn read_execution_range( &self, id: ExecutionId, from_step_id: u32, limit: usize, ) -> Result<Vec<JournalEntry>, DurableError>
Source§async fn finalize(
&self,
id: ExecutionId,
status: ExecutionStatus,
) -> Result<(), DurableError>
async fn finalize( &self, id: ExecutionId, status: ExecutionStatus, ) -> Result<(), DurableError>
Source§async fn prune(&self, policy: &RetentionPolicy) -> Result<u64, DurableError>
async fn prune(&self, policy: &RetentionPolicy) -> Result<u64, DurableError>
policy and return the number of rows deleted. Read moreSource§async fn sweep_orphans(
&self,
policy: &RetentionPolicy,
) -> Result<u64, DurableError>
async fn sweep_orphans( &self, policy: &RetentionPolicy, ) -> Result<u64, DurableError>
running rows. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DurableBackendEnum
impl !UnwindSafe for DurableBackendEnum
impl Freeze for DurableBackendEnum
impl Send for DurableBackendEnum
impl Sync for DurableBackendEnum
impl Unpin for DurableBackendEnum
impl UnsafeUnpin for DurableBackendEnum
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> 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