pub struct WalReader { /* private fields */ }Expand description
Sequential WAL reader.
Implementations§
Source§impl WalReader
impl WalReader
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open a WAL file for reading.
If the file begins with a valid WALP preamble (16 bytes), it is
consumed and stored for use as AAD during decryption. Files without a
preamble (unencrypted segments) start reading from offset 0 directly.
Automatically opens the companion double-write buffer file
(*.dwb) if it exists alongside the WAL file.
Sourcepub fn segment_preamble(&self) -> Option<&SegmentPreamble>
pub fn segment_preamble(&self) -> Option<&SegmentPreamble>
The preamble read from this segment file, if present.
Returns None for unencrypted segments (no preamble written).
Sourcepub fn next_record(&mut self) -> Result<Option<WalRecord>>
pub fn next_record(&mut self) -> Result<Option<WalRecord>>
Read the next record from the WAL.
Returns None at EOF (clean end) or at the first corruption point.
Returns Err only for I/O errors or unknown required record types.
Sourcepub fn records(self) -> WalRecordIter ⓘ
pub fn records(self) -> WalRecordIter ⓘ
Iterator over all valid records in the WAL.
Auto Trait Implementations§
impl Freeze for WalReader
impl RefUnwindSafe for WalReader
impl Send for WalReader
impl !Sync for WalReader
impl Unpin for WalReader
impl UnsafeUnpin for WalReader
impl UnwindSafe for WalReader
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