Expand description
On-disk snapshot storage.
The storage file is a small page container. A snapshot is encoded into a sequence of fixed-size pages, each page carrying its own length and CRC. This keeps the file format inspectable and lets recovery distinguish a complete snapshot from a torn write without relying on external crates.
Constants§
- MAX_
SNAPSHOT_ BYTES - Maximum encoded snapshot size accepted by the file and byte APIs.
- MAX_
SNAPSHOT_ PAYLOAD_ BYTES - Maximum state payload that can fit in a valid snapshot of the configured maximum size.
- PAGE_
SIZE
Functions§
- read_
snapshot - Read a snapshot. A missing file is treated as an empty database.
- read_
snapshot_ bytes - Validate and decode snapshot bytes without touching the filesystem.
- write_
snapshot - Write a complete database snapshot atomically.