Skip to main content

Module storage

Module storage 

Source
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.