#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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.
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
Return this backend’s stable capability description.
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>
Append an entry and return its database-assigned global sequence number. Read more
Source§async fn read_execution(
&self,
id: ExecutionId,
) -> Result<Vec<JournalEntry>, DurableError>
async fn read_execution( &self, id: ExecutionId, ) -> Result<Vec<JournalEntry>, DurableError>
Read every entry of an execution in append order. Read more
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>
Transition an execution to a terminal status. Read more
Source§async fn prune(&self, policy: &RetentionPolicy) -> Result<u64, DurableError>
async fn prune(&self, policy: &RetentionPolicy) -> Result<u64, DurableError>
Prune terminal executions according to
policy and return the number of rows deleted. 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
Mutably borrows from an owned value. Read more
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>
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 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>
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