pub struct FileLog { /* private fields */ }Expand description
Filesystem append log. Each append is flushed and fsynced before returning.
A crash mid-append leaves a torn, never-acked record at the tail; open
truncates it away so replay stops at the durability point of the last
acked transaction and later appends extend a clean tail.
Implementations§
Trait Implementations§
Source§impl TransactionLog for FileLog
impl TransactionLog for FileLog
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 moreAuto Trait Implementations§
impl !Freeze for FileLog
impl RefUnwindSafe for FileLog
impl Send for FileLog
impl Sync for FileLog
impl Unpin for FileLog
impl UnsafeUnpin for FileLog
impl UnwindSafe for FileLog
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