Skip to main content

Module persistence

Module persistence 

Source
Expand description

Crash-atomic persistence (Frame0File + StateFile) with zero mmap and zero unsafe.

Structs§

AppBuildId
Application build identifier stamped into frame0.nv02 footers for cache invalidation.
Frame0File
Frame-0 NV02 keyframe file (frame0.nv02) + 40-byte little-endian footer.
Frame0Footer
Frame0Meta
StateByteLen
Encoded state-file byte length returned by StateFile::save.
StateFile
Plain atomic-rename state file: 24-byte header [magic:8, schema:u32, len:u32, xxh64:u64] + payload, where xxh64 covers both the 16-byte header prefix and the payload bytes.
StateRecoveryStats
StateSaveOutcome

Enums§

Frame0Miss
PersistenceError

Constants§

DEFAULT_FRAME0_FILE_NAME
DEFAULT_STATE_FILE_NAME
FRAME0_FOOTER_SIZE
MAX_FRAME0_FILE_BYTES
Maximum accepted frame0.nv02 size (64 MiB) to bound memory against hostile/corrupt files.
MAX_STATE_FILE_BYTES
Maximum accepted state.nv payload size (64 MiB) to bound memory against hostile/corrupt files.
STATE_FILE_HEADER_SIZE
STATE_FILE_MAGIC

Functions§

write_file_atomic
Atomically writes bytes to path via exclusive create_new sibling temp file -> optional sync_all -> rename -> optional parent-directory sync_all.