pub struct WalFile { /* private fields */ }Implementations§
Source§impl WalFile
impl WalFile
Sourcepub fn open(path: &Path) -> Result<Self, MemoryError>
pub fn open(path: &Path) -> Result<Self, MemoryError>
Open or create a WAL file. If it exists, read the header and entry count.
Sourcepub fn append_save(&mut self, entry: &WalEntry) -> Result<(), MemoryError>
pub fn append_save(&mut self, entry: &WalEntry) -> Result<(), MemoryError>
Append a save entry to the WAL.
Sourcepub fn append_tombstone(
&mut self,
index: usize,
timestamp: f64,
) -> Result<(), MemoryError>
pub fn append_tombstone( &mut self, index: usize, timestamp: f64, ) -> Result<(), MemoryError>
Append a tombstone entry (deletion).
Sourcepub fn read_entries(path: &Path) -> Result<Vec<WalEntry>, MemoryError>
pub fn read_entries(path: &Path) -> Result<Vec<WalEntry>, MemoryError>
Read all entries from the WAL (for replay on open).
Sourcepub fn truncate(&mut self) -> Result<(), MemoryError>
pub fn truncate(&mut self) -> Result<(), MemoryError>
Truncate the WAL (after merge into .h5).
Sourcepub fn pending_count(&self) -> u32
pub fn pending_count(&self) -> u32
Number of pending entries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WalFile
impl RefUnwindSafe for WalFile
impl Send for WalFile
impl Sync for WalFile
impl Unpin for WalFile
impl UnsafeUnpin for WalFile
impl UnwindSafe for WalFile
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> 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