Skip to main content

VersionedPaneTree

Struct VersionedPaneTree 

Source
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

Source

pub fn singleton(surface_key: impl Into<String>) -> Self

Build a singleton versioned tree holding one root leaf.

Source

pub fn from_pane_tree(tree: &PaneTree) -> Self

Build a versioned tree from a canonical PaneTree.

Source

pub fn from_snapshot(snapshot: &PaneTreeSnapshot) -> Self

Build a versioned tree from a canonical snapshot.

Source

pub fn root(&self) -> &Arc<PersistentNode>

Root node of this version.

Source

pub fn root_id(&self) -> PaneId

Root pane id.

Source

pub const fn next_id(&self) -> PaneId

Next deterministic id value.

Source

pub const fn schema_version(&self) -> u16

Schema version.

Source

pub fn node_count(&self) -> usize

Number of nodes in this version.

Source

pub fn depth(&self) -> usize

Maximum tree depth in this version.

Source

pub fn to_snapshot(&self) -> PaneTreeSnapshot

Flatten to a canonical snapshot (reconstructing parent links).

Source

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).

Source

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.

Source

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.

Source

pub const fn operation_strategy( kind: PaneOperationKind, ) -> PersistentApplyStrategy

Strategy this prototype uses for an operation kind.

Trait Implementations§

Source§

impl Clone for VersionedPaneTree

Source§

fn clone(&self) -> VersionedPaneTree

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VersionedPaneTree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.