pub struct WinSnapshotStore {
path: PathBuf,
}Expand description
Production store: thin wrapper over VolumeIndex::{load_from, save_to}
plus fs::{metadata, remove_file} on the volume’s snapshot path.
Fields§
§path: PathBufImplementations§
Trait Implementations§
Source§impl SnapshotStore for WinSnapshotStore
impl SnapshotStore for WinSnapshotStore
Source§fn 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.Source§fn 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.Source§fn 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.
Auto Trait Implementations§
impl Freeze for WinSnapshotStore
impl RefUnwindSafe for WinSnapshotStore
impl Send for WinSnapshotStore
impl Sync for WinSnapshotStore
impl Unpin for WinSnapshotStore
impl UnsafeUnpin for WinSnapshotStore
impl UnwindSafe for WinSnapshotStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more