pub struct AtomicMemoryWriter<C: ConnectionTrait> { /* private fields */ }Expand description
Atomic memory writer that ensures multi-index consistency
Implementations§
Source§impl<C: ConnectionTrait> AtomicMemoryWriter<C>
impl<C: ConnectionTrait> AtomicMemoryWriter<C>
Sourcepub fn write_atomic(
&self,
memory_id: impl Into<String>,
ops: Vec<MemoryOp>,
) -> Result<AtomicWriteResult>
pub fn write_atomic( &self, memory_id: impl Into<String>, ops: Vec<MemoryOp>, ) -> Result<AtomicWriteResult>
Write an atomic memory item with all its components
This is the main entry point for atomic multi-index writes. Either all operations succeed, or the entire write can be retried.
§Arguments
memory_id- Unique ID for this memory itemops- Operations to apply atomically
§Returns
The intent ID on success
Sourcepub fn recover(&self) -> Result<RecoveryReport>
pub fn recover(&self) -> Result<RecoveryReport>
Recover incomplete intents on startup
This should be called during connection initialization to replay any intents that were interrupted by a crash.
Auto Trait Implementations§
impl<C> !Freeze for AtomicMemoryWriter<C>
impl<C> RefUnwindSafe for AtomicMemoryWriter<C>where
C: RefUnwindSafe,
impl<C> Send for AtomicMemoryWriter<C>where
C: Send,
impl<C> Sync for AtomicMemoryWriter<C>where
C: Sync,
impl<C> Unpin for AtomicMemoryWriter<C>where
C: Unpin,
impl<C> UnwindSafe for AtomicMemoryWriter<C>where
C: UnwindSafe,
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