pub struct Journal<'write> { /* private fields */ }Expand description
The journal inside one write, for sync’s steps.
Implementations§
Source§impl<'write> Journal<'write>
impl<'write> Journal<'write>
Sourcepub fn operation(
&self,
id: OperationId,
) -> Result<Option<OperationRecord>, DbError>
pub fn operation( &self, id: OperationId, ) -> Result<Option<OperationRecord>, DbError>
The operation’s journal row, as this write sees it; None once it
has finished, or if it never existed.
Sourcepub fn operations(&self, kind: &str) -> Result<Vec<OperationRecord>, DbError>
pub fn operations(&self, kind: &str) -> Result<Vec<OperationRecord>, DbError>
The journal’s rows of kind, oldest first, as this write sees them.
Sourcepub fn advance_operation(&self, update: &OperationUpdate) -> Result<(), DbError>
pub fn advance_operation(&self, update: &OperationUpdate) -> Result<(), DbError>
Advance an operation one step past the row it read; its pending
record and retry wait end with the step it left. A row that has
moved on since fails with OperationChanged.
Sourcepub fn store_state(&self) -> Result<StoreState, DbError>
pub fn store_state(&self) -> Result<StoreState, DbError>
Membership and audience state after the applied slots, as this write sees it.
Sourcepub fn applied_slot(&self) -> Result<u64, DbError>
pub fn applied_slot(&self) -> Result<u64, DbError>
The last slot whose effects this device has applied.
Sourcepub fn start_operation(
&self,
operation: &NewOperation,
) -> Result<OperationId, DbError>
pub fn start_operation( &self, operation: &NewOperation, ) -> Result<OperationId, DbError>
Journal an operation before its first step, which sync runs and
ends on its own; coven_operations doesn’t list it.
Sourcepub fn start_app_operation(
&self,
operation: &NewOperation,
kind: &str,
) -> Result<OperationId, DbError>
pub fn start_app_operation( &self, operation: &NewOperation, kind: &str, ) -> Result<OperationId, DbError>
Journal an operation the app’s write asks for, of kind as sync
names it, before its first step. It is listed in coven_operations
from this write’s commit until the app acknowledges its outcome.
Sourcepub fn operation_pending<P: PendingValue>(
&self,
id: OperationId,
) -> Result<Option<P>, DbError>
pub fn operation_pending<P: PendingValue>( &self, id: OperationId, ) -> Result<Option<P>, DbError>
The pending record that names the operation, if any.
Sourcepub fn pending_can_retry<P: PendingValue>(
&self,
subject: &P::Subject,
) -> Result<bool, DbError>
pub fn pending_can_retry<P: PendingValue>( &self, subject: &P::Subject, ) -> Result<bool, DbError>
Whether automatic work can retry the subject with the coven and schema versions installed now.
Sourcepub fn clear_pending<S: Serialize>(&self, subject: &S) -> Result<(), DbError>
pub fn clear_pending<S: Serialize>(&self, subject: &S) -> Result<(), DbError>
Clear the subject’s pending record.
Sourcepub fn clear_retry(&self, subject: RetrySubject) -> Result<(), DbError>
pub fn clear_retry(&self, subject: RetrySubject) -> Result<(), DbError>
Clear the subject’s retry wait.