Expand description
The device store: one JSON file, written atomically and only when a device record changes, batched so a burst of changes is one write.
Structs§
- Dirty
- Wakes the writer when devices change.
Enums§
- Store
Error - Store errors.
Constants§
- STORE_
VERSION - The store file’s format version.
- WRITE_
DELAY - How long changes are gathered before one write.
Functions§
- load
- Load devices from
path; a missing file is an empty store. - serialize
- Serialize devices for the store file.
- write_
atomic - Write
contentstopathatomically: a temporary file in the same directory, synced, then renamed over the old one. On Unix the file is readable by its owner only, since backups hold the network key.