pub trait SnapshotStore: Send + Sync {
// Required methods
fn load(&self) -> Result<(VolumeIndex, u64, i64)>;
fn file_bytes(&self) -> u64;
fn save_atomic(
&self,
idx: &VolumeIndex,
journal_id: u64,
next_usn: i64,
) -> Result<()>;
fn remove(&self);
}Expand description
Snapshot persistence for one volume ({index_dir}\{letter}.fmfidx).
Required Methods§
Sourcefn load(&self) -> Result<(VolumeIndex, u64, i64)>
fn load(&self) -> Result<(VolumeIndex, u64, i64)>
Load the persisted snapshot: the rebuilt index plus the journal
checkpoint (journal_id, next_usn) it was saved with.
ErrorKind::NotFound means “first run” (not a failure); any other
error means a corrupt/unreadable file — the caller counts it in
snapshot_load_failures and falls back to a full scan.
Sourcefn file_bytes(&self) -> u64
fn file_bytes(&self) -> u64
Size of the persisted snapshot in bytes (observability only — the
restore ScanTrace). Best effort; 0 when unknown.
Sourcefn save_atomic(
&self,
idx: &VolumeIndex,
journal_id: u64,
next_usn: i64,
) -> Result<()>
fn save_atomic( &self, idx: &VolumeIndex, journal_id: u64, next_usn: i64, ) -> Result<()>
Persist the index with its checkpoint atomically (tmp + rename): a torn write must never become a loadable snapshot.