pub struct EntityTreeSnapshot {
pub store_snapshot: Option<StoreSnapshot>,
pub root_ids: Vec<EntityId>,
}Expand description
Snapshot of an entity tree for undo.
Capture is O(1): store_snapshot is a whole-store im::HashMap clone (structural
sharing). Restore is scoped: root_ids records the subtree roots passed to
snapshot(ids), and the per-entity Repository::restore walks that subtree (in both
the snapshot and the live store) and reconciles only it, leaving other trunks untouched.
Fields§
§store_snapshot: Option<StoreSnapshot>Whole-store snapshot captured at snapshot(ids) time (O(1) im clone).
root_ids: Vec<EntityId>The subtree roots (the ids passed to snapshot). Restore is scoped to these.
Trait Implementations§
Source§impl Clone for EntityTreeSnapshot
impl Clone for EntityTreeSnapshot
Source§impl Debug for EntityTreeSnapshot
impl Debug for EntityTreeSnapshot
Source§impl Default for EntityTreeSnapshot
impl Default for EntityTreeSnapshot
Source§impl<'de> Deserialize<'de> for EntityTreeSnapshot
impl<'de> Deserialize<'de> for EntityTreeSnapshot
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 !RefUnwindSafe for EntityTreeSnapshot
impl !UnwindSafe for EntityTreeSnapshot
impl Freeze for EntityTreeSnapshot
impl Send for EntityTreeSnapshot
impl Sync for EntityTreeSnapshot
impl Unpin for EntityTreeSnapshot
impl UnsafeUnpin for EntityTreeSnapshot
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