pub struct Snapshot<T> { /* private fields */ }Expand description
A stable, zero-copy view of the data currently retained by an AtomicLog.
A snapshot owns Arcs to every segment it exposes, so the underlying storage remains
alive for the lifetime of the snapshot. Refreshing a snapshot replaces its contents with
a newer captured view.
Implementations§
Source§impl<T> Snapshot<T>
impl<T> Snapshot<T>
Sourcepub fn refresh(&mut self)
pub fn refresh(&mut self)
Refreshes the snapshot in place to reflect the current state of the log.
This attempts a cheap same-head extension first, then an incremental segment append, and falls back to a full rebuild if continuity has been lost.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Snapshot<T>
impl<T> !RefUnwindSafe for Snapshot<T>
impl<T> Send for Snapshot<T>
impl<T> Sync for Snapshot<T>
impl<T> Unpin for Snapshot<T>
impl<T> UnsafeUnpin for Snapshot<T>
impl<T> !UnwindSafe for Snapshot<T>
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