Expand description
On-disk JSON store substrate: atomic writes and corruption quarantine.
Every persisted store in the kernel routes through these helpers so the two invariants hold everywhere: writes are atomic for readers (a crash mid-write cannot leave a half-written file), and an unreadable file is quarantined rather than silently reset or skipped.
Enums§
- Store
Error - Errors raised by the JSON-on-disk store helpers.
Functions§
- quarantine
- Rename a corrupt file to a sibling
<name>.corrupt-<pid>-<epoch-millis>-<n>and return the new path. The low-level primitive beneathread_json; it returns a bareio::Resultand leaves the original path free for a fresh default to take. - read_
json - Read and decode JSON from
path. - write_
atomic - Write
bytestopathatomically. - write_
json_ atomic - Serialize
valueas pretty-printed JSON and write it atomically topath.