Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Snapshot persistence: serialize a ScanReport to <home>/snapshots/<UTC-ts>.json and load the newest snapshot back.

§Filename format

%Y-%m-%d-%H%M%S.json (UTC). Lexicographic order on the filename matches chronological order, which load_latest relies on to find the previous snapshot without a separate index file.

§Loading

load_latest returns Ok(None) when no snapshot directory exists yet (first-ever run); any JSON parse failure on an existing snapshot is surfaced as Error::Scan.

Functions§

load_latest
Load the newest snapshot (lexicographic = chronological order for the stamp format). Returns Ok(None) when the directory does not yet exist (first-ever scan).
save
Persist a ScanReport under <paths.home>/snapshots/<UTC-ts>.json and return the path written.