Skip to main content

PaneTree

Struct PaneTree 

Source
pub struct PaneTree { /* private fields */ }
Expand description

Validated pane tree model for runtime usage.

Implementations§

Source§

impl PaneTree

Source

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

Build a singleton tree with one root leaf.

Source

pub fn from_snapshot(snapshot: PaneTreeSnapshot) -> Result<Self, PaneModelError>

Construct and validate from a serial snapshot.

Source

pub fn to_snapshot(&self) -> PaneTreeSnapshot

Export to canonical snapshot form.

Source

pub const fn root(&self) -> PaneId

Root node ID.

Source

pub const fn next_id(&self) -> PaneId

Next deterministic ID value.

Source

pub const fn schema_version(&self) -> u16

Current schema version.

Source

pub fn node(&self, id: PaneId) -> Option<&PaneNodeRecord>

Lookup a node by ID.

Source

pub fn nodes(&self) -> impl Iterator<Item = &PaneNodeRecord>

Iterate nodes in canonical ID order.

Source

pub fn validate(&self) -> Result<(), PaneModelError>

Validate internal invariants.

Source

pub fn invariant_report(&self) -> PaneInvariantReport

Structured invariant diagnostics for the current tree snapshot.

Source

pub fn state_hash(&self) -> u64

Deterministic structural hash of the current tree state.

This is intended for operation logs and replay diagnostics.

Source

pub fn begin_transaction(&self, transaction_id: u64) -> PaneTransaction

Start a transaction boundary for one or more structural operations.

Transactions stage mutations on a cloned working tree and provide a deterministic operation journal for replay, undo/redo, and auditing.

Source

pub fn apply_operation( &mut self, operation_id: u64, operation: PaneOperation, ) -> Result<PaneOperationOutcome, PaneOperationError>

Apply one structural operation atomically.

The operation is executed on a cloned working tree. On success, the mutated clone replaces self; on failure, self is unchanged.

Source

pub fn solve_layout(&self, area: Rect) -> Result<PaneLayout, PaneModelError>

Solve the split-tree into concrete rectangles for the provided viewport.

Deterministic tie-break rule:

  • Desired split size is floor(available * ratio).
  • If clamping is required by constraints, we clamp into the feasible interval for the first child; remainder goes to the second child.

Complexity:

  • Time: O(node_count) (single DFS over split tree)
  • Space: O(node_count) (output rectangle map)
Source

pub fn choose_dock_preview( &self, layout: &PaneLayout, pointer: PanePointerPosition, magnetic_field_cells: f64, ) -> Option<PaneDockPreview>

Pick the best magnetic docking preview at a pointer location.

Source

pub fn ranked_dock_previews_with_motion( &self, layout: &PaneLayout, pointer: PanePointerPosition, motion: PaneMotionVector, magnetic_field_cells: f64, excluded: Option<PaneId>, limit: usize, ) -> Vec<PaneDockPreview>

Return top-ranked magnetic docking candidates (best-first) using motion-aware intent weighting.

Source

pub fn plan_reflow_move_with_preview( &self, source: PaneId, layout: &PaneLayout, pointer: PanePointerPosition, motion: PaneMotionVector, inertial: Option<PaneInertialThrow>, magnetic_field_cells: f64, ) -> Result<PaneReflowMovePlan, PaneReflowPlanError>

Plan a pane move with inertial projection, magnetic docking, and pressure-sensitive snapping.

Source

pub fn apply_reflow_move_plan( &mut self, operation_seed: u64, plan: &PaneReflowMovePlan, ) -> Result<Vec<PaneOperationOutcome>, PaneOperationError>

Apply a previously planned reflow move.

Source

pub fn plan_edge_resize( &self, leaf: PaneId, layout: &PaneLayout, grip: PaneResizeGrip, pointer: PanePointerPosition, pressure: PanePressureSnapProfile, ) -> Result<PaneEdgeResizePlan, PaneEdgeResizePlanError>

Plan any-edge / any-corner organic resize for one leaf.

Source

pub fn apply_edge_resize_plan( &mut self, operation_seed: u64, plan: &PaneEdgeResizePlan, ) -> Result<Vec<PaneOperationOutcome>, PaneOperationError>

Apply all operations generated by an edge/corner resize plan.

Source

pub fn plan_group_move( &self, selection: &PaneSelectionState, layout: &PaneLayout, pointer: PanePointerPosition, motion: PaneMotionVector, inertial: Option<PaneInertialThrow>, magnetic_field_cells: f64, ) -> Result<PaneGroupTransformPlan, PaneReflowPlanError>

Plan a cluster move by moving the anchor and then reattaching members.

Source

pub fn plan_group_resize( &self, selection: &PaneSelectionState, layout: &PaneLayout, grip: PaneResizeGrip, pointer: PanePointerPosition, pressure: PanePressureSnapProfile, ) -> Result<PaneGroupTransformPlan, PaneEdgeResizePlanError>

Plan a cluster resize by resizing the shared outer boundary while preserving internal cluster ratios.

Source

pub fn apply_group_transform_plan( &mut self, operation_seed: u64, plan: &PaneGroupTransformPlan, ) -> Result<Vec<PaneOperationOutcome>, PaneOperationError>

Apply a group transform plan.

Source

pub fn plan_intelligence_mode( &self, mode: PaneLayoutIntelligenceMode, primary: PaneId, ) -> Result<Vec<PaneOperation>, PaneReflowPlanError>

Plan adaptive topology transitions using core split-tree operations.

Trait Implementations§

Source§

impl Clone for PaneTree

Source§

fn clone(&self) -> PaneTree

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PaneTree

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PaneTree

Source§

fn eq(&self, other: &PaneTree) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for PaneTree

Source§

impl StructuralPartialEq for PaneTree

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