Skip to main content

Module envelope

Module envelope 

Source
Expand description

The sealed frame every snapshot travels in: magic, version, region tag, payload length, payload, CRC-32. A load is untrusted input, so truncation, cross-region mixups, and bit rot each refuse by name before any payload parse.

Structs§

SnapshotFingerprint
The checksum a sealed snapshot already carries, reborrowed as its change fingerprint: two seals of identical payloads carry identical fingerprints, so a flusher can skip rewriting a region whose fingerprint matches its last flush — no second hash pass. A changed payload whose CRC-32 collides with the previous one (odds 2^-32 per flush) skips one write; the next real change heals it.

Enums§

SnapshotOpenError
SnapshotSealError

Constants§

SNAPSHOT_CHECKSUM_LEN
SNAPSHOT_HEADER_LEN
SNAPSHOT_MAGIC
SNAPSHOT_OVERHEAD_LEN
SNAPSHOT_VERSION

Functions§

open_snapshot
seal_snapshot
seal_snapshot_in_place
Seals a payload the caller already wrote at out[SNAPSHOT_HEADER_LEN..SNAPSHOT_HEADER_LEN + payload_len], sparing a large payload the staging copy seal_snapshot takes.
snapshot_fingerprint