pub struct WriteAheadLog { /* private fields */ }Expand description
Write-Ahead Log for durability and crash recovery
Implementations§
Source§impl WriteAheadLog
impl WriteAheadLog
Sourcepub fn current_sequence(&self) -> u64
pub fn current_sequence(&self) -> u64
Get current sequence number
Sourcepub fn oldest_sequence(&self) -> Option<u64>
pub fn oldest_sequence(&self) -> Option<u64>
Get the oldest available WAL sequence number.
Returns the first sequence found in the oldest WAL file, or None
if no WAL entries exist. Used by the replication catch-up protocol
to determine whether a follower can catch up from WAL alone.
Sourcepub fn set_replication_tx(&self, tx: Sender<WALEntry>)
pub fn set_replication_tx(&self, tx: Sender<WALEntry>)
Attach a broadcast sender for WAL replication.
When set, every append() call will publish the WAL entry to this
channel so the WAL shipper can stream it to connected followers.
Auto Trait Implementations§
impl !Freeze for WriteAheadLog
impl !RefUnwindSafe for WriteAheadLog
impl Send for WriteAheadLog
impl Sync for WriteAheadLog
impl Unpin 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