Expand description
The shared journal record engine.
Every journal in this crate writes fixed-size records into two alternating flash pages. A record becomes visible only when its final commit word is written, so a mount after power loss always recovers the previous committed record, never a partial write.
Enums§
Constants§
- PAGE_
SIZE - Flash page size shared by every backend the journals run on (nRF52840 NVMC and ESP32-S3 SPI flash are both 4 KiB-erase parts).
Traits§
- Page
Eraser - Record
Reader - Flash reader used by a journal mount and by the boot path’s walk-back scan.
- Record
Writer - Flash writer used by the journal’s two-stage record commit.
Functions§
- crc32
- CRC32 (reflected, polynomial 0xEDB88320) over a record body; the journals store it immediately before the commit word.
- erase_
journal_ page - generation_
is_ newer - Wraparound-safe generation comparison: a record numbered 0 supersedes
one numbered
u32::MAX. - write_
committed_ record - Write a record body first and its visibility marker last. The record’s last four bytes are the commit word (shared convention across every journal in this crate).