Module record

Module record 

Source
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§

CommitError

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§

PageEraser
RecordReader
Flash reader used by a journal mount and by the boot path’s walk-back scan.
RecordWriter
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).