pub struct StorageSnapshotDiff { /* private fields */ }Expand description
Computes and represents differences between storage snapshots.
Maintains cumulative DiffStats across repeated calls so callers can
observe aggregate diff activity without re-scanning results.
Implementations§
Source§impl StorageSnapshotDiff
impl StorageSnapshotDiff
Sourcepub fn diff(
&mut self,
old: &HashMap<String, SnapshotEntry>,
new: &HashMap<String, SnapshotEntry>,
) -> SnapshotDiffResult
pub fn diff( &mut self, old: &HashMap<String, SnapshotEntry>, new: &HashMap<String, SnapshotEntry>, ) -> SnapshotDiffResult
Compute the diff between old and new snapshots.
Each of the four result buckets is sorted by CID ascending for deterministic output. Statistics are updated atomically after the comparison is complete.
Sourcepub fn apply_patch(
&self,
base: &mut HashMap<String, SnapshotEntry>,
diff: &SnapshotDiffResult,
)
pub fn apply_patch( &self, base: &mut HashMap<String, SnapshotEntry>, diff: &SnapshotDiffResult, )
Apply a previously-computed diff to a mutable base snapshot map, bringing it forward to the state described by the diff.
Added→ insert the new entry intobase.Removed→ remove the entry frombase.Modified→ replace the entry inbasewith the new version.Unchanged→ no-op.
Trait Implementations§
Source§impl Debug for StorageSnapshotDiff
impl Debug for StorageSnapshotDiff
Source§impl Default for StorageSnapshotDiff
impl Default for StorageSnapshotDiff
Source§fn default() -> StorageSnapshotDiff
fn default() -> StorageSnapshotDiff
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StorageSnapshotDiff
impl RefUnwindSafe for StorageSnapshotDiff
impl Send for StorageSnapshotDiff
impl Sync for StorageSnapshotDiff
impl Unpin for StorageSnapshotDiff
impl UnsafeUnpin for StorageSnapshotDiff
impl UnwindSafe for StorageSnapshotDiff
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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