pub struct VersionedPaneTree { /* private fields */ }Expand description
One immutable version of a pane tree.
Cloning a version is cheap: it bumps the root Arc refcount and clones the
(usually empty) tree-level extension map.
Implementations§
Source§impl VersionedPaneTree
impl VersionedPaneTree
Sourcepub fn singleton(surface_key: impl Into<String>) -> Self
pub fn singleton(surface_key: impl Into<String>) -> Self
Build a singleton versioned tree holding one root leaf.
Sourcepub fn from_pane_tree(tree: &PaneTree) -> Self
pub fn from_pane_tree(tree: &PaneTree) -> Self
Build a versioned tree from a canonical PaneTree.
Sourcepub fn from_snapshot(snapshot: &PaneTreeSnapshot) -> Self
pub fn from_snapshot(snapshot: &PaneTreeSnapshot) -> Self
Build a versioned tree from a canonical snapshot.
Sourcepub fn root(&self) -> &Arc<PersistentNode>
pub fn root(&self) -> &Arc<PersistentNode>
Root node of this version.
Sourcepub const fn schema_version(&self) -> u16
pub const fn schema_version(&self) -> u16
Schema version.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes in this version.
Sourcepub fn to_snapshot(&self) -> PaneTreeSnapshot
pub fn to_snapshot(&self) -> PaneTreeSnapshot
Flatten to a canonical snapshot (reconstructing parent links).
Sourcepub fn to_pane_tree(&self) -> Result<PaneTree, PaneModelError>
pub fn to_pane_tree(&self) -> Result<PaneTree, PaneModelError>
Flatten and validate into a canonical PaneTree.
This is the bridge back to the production data structure and the basis of the differential equivalence oracle.
§Errors
Returns the canonical tree’s validation error if the flattened structure
violates a pane-tree invariant (which should never happen for a tree
built solely through VersionedPaneTree::apply_operation).
Sourcepub fn state_hash(&self) -> Result<u64, PaneModelError>
pub fn state_hash(&self) -> Result<u64, PaneModelError>
Deterministic structural hash, identical to the canonical
PaneTree::state_hash.
§Errors
Returns a validation error if the flattened tree is malformed.
Sourcepub fn apply_operation(
&self,
operation: &PaneOperation,
) -> Result<Self, PersistentApplyError>
pub fn apply_operation( &self, operation: &PaneOperation, ) -> Result<Self, PersistentApplyError>
Apply one structural operation, returning a new version.
self is never mutated (persistence). Native operations path-copy with
structural sharing; PersistentApplyStrategy::Rebuild operations
delegate to the certified conservative baseline.
§Errors
Returns a PersistentApplyError mirroring the canonical baseline’s
accept/reject decision for the operation.
Sourcepub const fn operation_strategy(
kind: PaneOperationKind,
) -> PersistentApplyStrategy
pub const fn operation_strategy( kind: PaneOperationKind, ) -> PersistentApplyStrategy
Strategy this prototype uses for an operation kind.
Trait Implementations§
Source§impl Clone for VersionedPaneTree
impl Clone for VersionedPaneTree
Source§fn clone(&self) -> VersionedPaneTree
fn clone(&self) -> VersionedPaneTree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more