pub struct Wal { /* private fields */ }Implementations§
Source§impl Wal
impl Wal
pub fn open(path: &Path, mode: IoMode) -> Result<Wal>
Sourcepub fn inspect(path: &Path, mode: IoMode) -> Result<Scan>
pub fn inspect(path: &Path, mode: IoMode) -> Result<Scan>
Walk the log without opening it for use and without changing a byte
of it – no set_len, no sync_data, and no refusal either: the
caller gets the Stop and decides. recover() is the caller, and it
needs all three of those properties, because it is the path that has
to still work on exactly the images open refuses.
pub fn end_offset(&self) -> u64
pub fn append(&mut self, kind: RecKind, payload: &[u8]) -> Result<u64>
Sourcepub fn flush(&mut self) -> Result<()>
pub fn flush(&mut self) -> Result<()>
SyncMode::Normal’s barrier: durable against an OS crash, not
necessarily against a loss of power to the drive.
Push the buffer to the file. Not a barrier. Every path that reads the
file or promises durability calls this first.
pub fn sync_data(&mut self) -> Result<()>
Sourcepub fn sync_full(&mut self) -> Result<()>
pub fn sync_full(&mut self) -> Result<()>
SyncMode::Full’s barrier: the strongest this platform can issue.
Sourcepub fn sync_full_primitive(&self) -> &'static str
pub fn sync_full_primitive(&self) -> &'static str
The exact primitive sync_full issues here, so a measurement can name
what it did rather than imply it.
Sourcepub fn set_lsn_floor(&mut self, floor: u64)
pub fn set_lsn_floor(&mut self, floor: u64)
Raise the LSN floor. scan derives next_lsn from the file, so after a
rotation leaves the log empty, a restart would otherwise renumber from 1.
The store persists the high-water mark in the superblock and re-supplies
it here at open.