pub struct MemoryLog(/* private fields */);Expand description
In-memory log implementation.
Trait Implementations§
Source§impl TransactionLog for MemoryLog
impl TransactionLog for MemoryLog
Source§fn append(&self, record: &TxRecord) -> Result<(), LogError>
fn append(&self, record: &TxRecord) -> Result<(), LogError>
Durably appends exactly the next transaction. Read more
Source§fn tx_range(
&self,
start: u64,
end: Option<u64>,
) -> Result<Vec<TxRecord>, LogError>
fn tx_range( &self, start: u64, end: Option<u64>, ) -> Result<Vec<TxRecord>, LogError>
Returns records in the half-open transaction range
[start, end). Read moreSource§fn append_async<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 TxRecord,
) -> Pin<Box<dyn Future<Output = Result<(), LogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_async<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 TxRecord,
) -> Pin<Box<dyn Future<Output = Result<(), LogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Durably appends exactly the next transaction without blocking an async
runtime worker. Synchronous logs use
Self::append by default;
storage-backed logs override this method and await their backend. Read moreSource§fn append_batch_async<'life0, 'life1, 'async_trait>(
&'life0 self,
records: &'life1 [TxRecord],
) -> Pin<Box<dyn Future<Output = Result<(), LogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_batch_async<'life0, 'life1, 'async_trait>(
&'life0 self,
records: &'life1 [TxRecord],
) -> Pin<Box<dyn Future<Output = Result<(), LogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Durably appends a contiguous run of transactions under a single
durability boundary where the backend supports one (one
fsync, one
object, one database transaction), so group commit amortizes the
per-append cost across the batch. records must be contiguous in t
starting at the log’s next expected t; an empty slice is a no-op. The
default appends them one at a time; batching backends override this. Read moreAuto Trait Implementations§
impl Freeze for MemoryLog
impl RefUnwindSafe for MemoryLog
impl Send for MemoryLog
impl Sync for MemoryLog
impl Unpin for MemoryLog
impl UnsafeUnpin for MemoryLog
impl UnwindSafe for MemoryLog
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