pub struct InMemoryFaultState { /* private fields */ }Expand description
A bounded, process-local FaultStateStore.
This implementation makes the reservation ordering executable without a database. It is not durable: a restart starts from an empty state, which the contract permits because a restart may invoke fewer retries than were reserved, never more.
Implementations§
Source§impl InMemoryFaultState
impl InMemoryFaultState
Sourcepub fn new(limit: RetryStateLimit) -> Self
pub fn new(limit: RetryStateLimit) -> Self
Constructs an empty bounded state.
Trait Implementations§
Source§impl Debug for InMemoryFaultState
impl Debug for InMemoryFaultState
Source§impl FaultStateStore for InMemoryFaultState
impl FaultStateStore for InMemoryFaultState
Source§fn reserved_ordinal(
&self,
key: RetryKey,
) -> BoxFuture<'_, Result<Option<RetryOrdinal>, FaultStateError>>
fn reserved_ordinal( &self, key: RetryKey, ) -> BoxFuture<'_, Result<Option<RetryOrdinal>, FaultStateError>>
Returns the ordinal already reserved for
key, when one exists.Source§fn reserve(
&self,
reservation: RetryReservation,
) -> BoxFuture<'_, Result<(), FaultStateError>>
fn reserve( &self, reservation: RetryReservation, ) -> BoxFuture<'_, Result<(), FaultStateError>>
Commits one reservation, consuming its ordinal.
Source§fn resolve(&self, key: RetryKey) -> BoxFuture<'_, Result<(), FaultStateError>>
fn resolve(&self, key: RetryKey) -> BoxFuture<'_, Result<(), FaultStateError>>
Marks
key resolved because its unit of work succeeded or was skipped. Read moreSource§fn clear_resolved(&self) -> BoxFuture<'_, Result<(), FaultStateError>>
fn clear_resolved(&self) -> BoxFuture<'_, Result<(), FaultStateError>>
Clears every resolved key in the commit that advances the checkpoint.
Source§fn unresolved(&self) -> BoxFuture<'_, Result<u32, FaultStateError>>
fn unresolved(&self) -> BoxFuture<'_, Result<u32, FaultStateError>>
Returns the number of retained unresolved keys.
Source§fn bind(
&self,
_context: ChunkTransactionContext,
) -> BoxFuture<'_, Result<(), FaultStateError>>
fn bind( &self, _context: ChunkTransactionContext, ) -> BoxFuture<'_, Result<(), FaultStateError>>
Binds durable state to the step execution about to run. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryFaultState
impl RefUnwindSafe for InMemoryFaultState
impl Send for InMemoryFaultState
impl Sync for InMemoryFaultState
impl Unpin for InMemoryFaultState
impl UnsafeUnpin for InMemoryFaultState
impl UnwindSafe for InMemoryFaultState
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