pub struct Snapshot {
pub cursor: WatchCursor,
pub entries: HashMap<String, KvEntry>,
}Expand description
Result of loading a snapshot from disk.
Fields§
§cursor: WatchCursorWatch cursor at the time of the last checkpoint.
entries: HashMap<String, KvEntry>Live KV entries keyed by name (deduplicated, deletes applied).
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn stale_keys<'a, I>(&'a self, current_keys: I) -> Vec<&'a str>where
I: IntoIterator<Item = &'a str>,
pub fn stale_keys<'a, I>(&'a self, current_keys: I) -> Vec<&'a str>where
I: IntoIterator<Item = &'a str>,
Keys present in this snapshot but absent from a fresh scan result.
After a cursor-expired fallback to full watch_all(), callers should
compare the snapshot against the live key set and emit synthetic
Delete events for stale keys to ensure convergence.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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