Expand description
Validated, atomic JSON persistence serialized by one application state.
Structs§
- Storage
- Reads and writes
settings.jsonandaccounts.jsonin the data folder.
Enums§
- Storage
Error - Why local data couldn’t be read or written.
Statics§
- TEMP_
SEQUENCE 🔒 - Distinguishes temporary files written concurrently by this process.
Functions§
- read_
json 🔒 - Parses a JSON file.
- replace_
file 🔒 - Replaces
towithfromin one step, flushing the move to disk. - sync_
directory 🔒 - Does nothing; this platform doesn’t need directory flushes.
- validate_
accounts 🔒 - Validates each account and rejects duplicate IDs.
- write_
json_ 🔒atomic - Writes JSON to a temporary file, flushes it, and moves it over
path, so a crash leaves either the old or the new file. On Unix the file is readable only by its owner.