Expand description
WAL reader for crash recovery and replay.
Reads records sequentially from a WAL file, validating checksums and magic numbers. Stops at the first corruption point — everything before that point is the committed prefix.
§Replay invariants
- Replay is deterministic: the same WAL file always produces the same sequence of records.
- Replay is idempotent: replaying the same record twice has the same effect as replaying it once.
- Unknown optional record types (bit 15 clear) are skipped.
- Unknown required record types (bit 15 set) cause a replay failure.
§Encryption
WalReader::open is the replay constructor: it takes the key ring and
hands out plaintext, so a consumer cannot act on ciphertext by forgetting to
decrypt. WalReader::open_raw is the opt-in structural constructor for
code that only walks record framing.
Structs§
- WalReader
- Sequential WAL reader.
- WalRecord
Iter - Iterator over WAL records.
Enums§
- Stop
Reason - Why a reader stopped producing records.