pub struct WalManager { /* private fields */ }Expand description
WAL manager coordinates log writing and recovery
Implementations§
Source§impl WalManager
impl WalManager
pub fn new(config: WalConfig) -> Result<WalManager, Error>
Sourcepub fn open(&mut self) -> Result<(), Error>
pub fn open(&mut self) -> Result<(), Error>
Open the WAL for writing
This creates or opens the current WAL segment for appending records.
Sourcepub fn recover(&self) -> Result<Vec<WalRecord>, Error>
pub fn recover(&self) -> Result<Vec<WalRecord>, Error>
Recover records from the WAL
This reads all segments and returns committed records for replay. Incomplete transactions are rolled back (not included).
Sourcepub fn recover_with_markers(&self) -> Result<Vec<WalRecord>, Error>
pub fn recover_with_markers(&self) -> Result<Vec<WalRecord>, Error>
Recover records with transaction markers included
Unlike recover(), this includes BEGIN_TX and COMMIT_TX markers.
Sourcepub fn stats(&self) -> Result<RecoveryStats, Error>
pub fn stats(&self) -> Result<RecoveryStats, Error>
Get statistics about the WAL
Sourcepub fn segment_manager(&self) -> SegmentManager
pub fn segment_manager(&self) -> SegmentManager
Get a segment manager for the WAL
Auto Trait Implementations§
impl Freeze for WalManager
impl RefUnwindSafe for WalManager
impl Send for WalManager
impl Sync for WalManager
impl Unpin for WalManager
impl UnwindSafe for WalManager
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