pub struct Reader<'w> { /* private fields */ }Expand description
Streaming reader over the log, starting at a caller-chosen LSN.
Holds an immutable borrow of the Wal’s directory and segment list (so the
writer’s &mut self methods are excluded for the reader’s lifetime), an
owned File for the segment currently being scanned, and a reusable I/O
buffer. Segments past the first are opened lazily as the scan crosses each
boundary.
Implementations§
Source§impl<'w> Reader<'w>
impl<'w> Reader<'w>
Sourcepub fn next(&mut self) -> Option<Result<(Lsn, &[u8])>>
pub fn next(&mut self) -> Option<Result<(Lsn, &[u8])>>
Yield the next record at or after from, or None at end of log.
Lending-style: the returned borrow is tied to &mut self and is valid
only until the following call (§6.1). Records before from are skipped.
When the current segment’s records end (sentinel / short read / invalid /
LSN-continuity break), the reader follows the roll to the next segment;
at the last segment that ends the stream cleanly. Torn-tail/corruption
classification is a recovery concern (§8.2), not a live read.