pub struct Snapshot { /* private fields */ }Expand description
One atomic, immutable transcript state.
Cloning a snapshot is O(1): unchanged readers share the same immutable item
backing. Store::restore adopts that backing and continues exactly at its
saved version; Store::from_items instead starts a new version-zero epoch.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn new(version: Version, items: Vec<Item>) -> Self
pub fn new(version: Version, items: Vec<Item>) -> Self
Creates a versioned snapshot by adopting an owned item history.
Sourcepub fn into_parts(self) -> (Version, Vec<Item>)
pub fn into_parts(self) -> (Version, Vec<Item>)
Transfers ownership of the version and ordered items.
If another snapshot or store still shares the item backing, this method clones the items to produce the requested unique vector.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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