pub struct OperationService<B: JournalBackend> { /* private fields */ }Expand description
Journal-backed owner of durable operation intent, dispatch, and raw receipts.
Implementations§
Source§impl<B: JournalBackend> OperationService<B>
impl<B: JournalBackend> OperationService<B>
Sourcepub fn new(backend: B) -> Self
pub fn new(backend: B) -> Self
Creates a service over one backend value without acquiring authority.
Creates a service over a shared backend, supporting crash/reopen tests.
Sourcepub fn resume(&mut self) -> Result<(), OperationError>
pub fn resume(&mut self) -> Result<(), OperationError>
Acquires a fresh fenced journal lease after start or recovery.
Sourcepub fn state(
&self,
operation: &OperationId,
) -> Result<Option<DurableOperationState>, OperationError>
pub fn state( &self, operation: &OperationId, ) -> Result<Option<DurableOperationState>, OperationError>
Reconstructs one operation solely from a verified journal snapshot.
Sourcepub fn record(
&self,
operation: &OperationId,
) -> Result<Option<OperationRecord>, OperationError>
pub fn record( &self, operation: &OperationId, ) -> Result<Option<OperationRecord>, OperationError>
Reconstructs the complete durable record from one verified snapshot.
Sourcepub fn execute(
&mut self,
intent: &OperationIntent,
grant: &OperationGrant,
attempt: &OperationAttempt,
performer: &mut dyn OperationPerformer,
) -> Result<DurableOperationState, OperationError>
pub fn execute( &mut self, intent: &OperationIntent, grant: &OperationGrant, attempt: &OperationAttempt, performer: &mut dyn OperationPerformer, ) -> Result<DurableOperationState, OperationError>
Persists intent and dispatch, calls the performer once, then persists its receipt.
If recovery finds a durable dispatch, this method returns that state and never calls the performer. Missing acknowledgement likewise returns the durable dispatch state; it is not converted into failure or retry authority.
Auto Trait Implementations§
impl<B> Freeze for OperationService<B>
impl<B> RefUnwindSafe for OperationService<B>
impl<B> Send for OperationService<B>
impl<B> Sync for OperationService<B>
impl<B> Unpin for OperationService<B>
impl<B> UnsafeUnpin for OperationService<B>
impl<B> UnwindSafe for OperationService<B>
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