pub struct WorkspaceSnapshot {
pub schema_version: u16,
pub pane_tree: PaneTreeSnapshot,
pub active_pane_id: Option<PaneId>,
pub metadata: WorkspaceMetadata,
pub interaction_timeline: PaneInteractionTimeline,
pub extensions: BTreeMap<String, String>,
}Expand description
Persisted workspace state, wrapping a pane tree with metadata.
Forward-compatible: unknown fields land in extensions for round-tripping.
Fields§
§schema_version: u16Schema version for migration detection.
pane_tree: PaneTreeSnapshotThe pane tree layout.
active_pane_id: Option<PaneId>Which pane had focus when the workspace was persisted.
metadata: WorkspaceMetadataWorkspace metadata (name, timestamps, host info).
interaction_timeline: PaneInteractionTimelinePersistent pane interaction timeline for undo/redo/replay.
extensions: BTreeMap<String, String>Forward-compatible extension bag.
Implementations§
Source§impl WorkspaceSnapshot
impl WorkspaceSnapshot
Sourcepub fn new(pane_tree: PaneTreeSnapshot, metadata: WorkspaceMetadata) -> Self
pub fn new(pane_tree: PaneTreeSnapshot, metadata: WorkspaceMetadata) -> Self
Create a new v1 workspace snapshot.
Sourcepub fn with_active_pane(self, pane_id: PaneId) -> Self
pub fn with_active_pane(self, pane_id: PaneId) -> Self
Create a snapshot with a focused pane.
Sourcepub fn validate(&self) -> Result<(), WorkspaceValidationError>
pub fn validate(&self) -> Result<(), WorkspaceValidationError>
Validate the snapshot against schema and structural invariants.
Sourcepub fn canonicalize(&mut self)
pub fn canonicalize(&mut self)
Canonicalize for deterministic serialization.
Sourcepub fn state_hash(&self) -> u64
pub fn state_hash(&self) -> u64
Deterministic hash for state diagnostics.
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Count of leaf panes in the tree.
Trait Implementations§
Source§impl Clone for WorkspaceSnapshot
impl Clone for WorkspaceSnapshot
Source§fn clone(&self) -> WorkspaceSnapshot
fn clone(&self) -> WorkspaceSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkspaceSnapshot
impl Debug for WorkspaceSnapshot
Source§impl<'de> Deserialize<'de> for WorkspaceSnapshot
impl<'de> Deserialize<'de> for WorkspaceSnapshot
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
Source§impl PartialEq for WorkspaceSnapshot
impl PartialEq for WorkspaceSnapshot
Source§impl Serialize for WorkspaceSnapshot
impl Serialize for WorkspaceSnapshot
impl Eq for WorkspaceSnapshot
impl StructuralPartialEq for WorkspaceSnapshot
Auto Trait Implementations§
impl Freeze for WorkspaceSnapshot
impl RefUnwindSafe for WorkspaceSnapshot
impl Send for WorkspaceSnapshot
impl Sync for WorkspaceSnapshot
impl Unpin for WorkspaceSnapshot
impl UnsafeUnpin for WorkspaceSnapshot
impl UnwindSafe for WorkspaceSnapshot
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