pub struct WriteAheadLog {
pub path: PathBuf,
pub entry_count: usize,
/* private fields */
}Fields§
§path: PathBuf§entry_count: usizeImplementations§
Source§impl WriteAheadLog
impl WriteAheadLog
pub fn open(path: &Path) -> Result<Self>
pub fn append(&mut self, entry: &WalEntry) -> Result<()>
Sourcepub fn append_batch(&mut self, entries: &[WalEntry]) -> Result<()>
pub fn append_batch(&mut self, entries: &[WalEntry]) -> Result<()>
Append many entries with a single sync_all at the end. Used by bulk
load, where per-entry fsync would dominate (one fsync per vector). The
batch is still crash-consistent: on a crash mid-batch, replay stops at
the last fully-written entry (length/checksum framing), and any partial
tail is ignored.
pub fn replay(&mut self) -> Result<Vec<WalEntry>>
pub fn checkpoint(&mut self) -> Result<()>
pub fn truncate_after_checkpoint(&mut self) -> Result<()>
pub fn entry_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for WriteAheadLog
impl RefUnwindSafe for WriteAheadLog
impl Send for WriteAheadLog
impl Sync for WriteAheadLog
impl Unpin for WriteAheadLog
impl UnsafeUnpin for WriteAheadLog
impl UnwindSafe for WriteAheadLog
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