Skip to main content

PaneNode

Enum PaneNode 

Source
pub enum PaneNode {
    Leaf(usize),
    HorizontalSplit {
        top: Box<PaneNode>,
        bottom: Box<PaneNode>,
        ratio: f32,
    },
    VerticalSplit {
        left: Box<PaneNode>,
        right: Box<PaneNode>,
        ratio: f32,
    },
}
Expand description

Internal node of the pane tree. Leaves reference a PaneState by index in PaneTree::leaves; splits hold two children with an explicit orientation and a ratio. New splits start at DEFAULT_SPLIT_RATIO; PaneTree::resize_active_split and PaneTree::equalize_ratios adjust them.

Variants§

§

Leaf(usize)

A concrete pane. The usize indexes into PaneTree::leaves.

§

HorizontalSplit

Two panes stacked top + bottom (a horizontal cut). ratio is the top child’s share of the total height, clamped to MIN_SPLIT_RATIO..=MAX_SPLIT_RATIO. Default 0.5 = even split. Issue #28 (2026-05-22): <C-w>= resets every ratio to 0.5; <C-w>+ / <C-w>- nudge the nearest HorizontalSplit ancestor’s ratio.

Fields

§top: Box<PaneNode>

The upper child.

§bottom: Box<PaneNode>

The lower child.

§ratio: f32

top’s share of the height, in 0.0..=1.0.

§

VerticalSplit

Two panes side by side left + right (a vertical cut). ratio is the left child’s share of the total width. <C-w>> / <C-w>< nudge the nearest VerticalSplit ancestor’s ratio.

Fields

§left: Box<PaneNode>

The left child.

§right: Box<PaneNode>

The right child.

§ratio: f32

left’s share of the width, in 0.0..=1.0.

Implementations§

Source§

impl PaneNode

Source

pub fn leaf(idx: usize) -> Self

Leaf-only constructor used at App init when there’s exactly one pane.

Source

pub fn is_single_leaf(&self) -> bool

True for the trivial single-leaf tree.

Source

pub fn for_each_leaf(&self, visit: &mut impl FnMut(usize))

Walk the tree depth-first and call visit on every leaf index, in left-to-right / top-to-bottom order.

Trait Implementations§

Source§

impl Clone for PaneNode

Source§

fn clone(&self) -> PaneNode

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 PaneNode

Source§

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

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

impl Default for PaneNode

Manual Default (tuple variants can’t use #[default]). Default = Leaf(0), matching the PaneTree::single shape for the trivial one-pane tree.

Source§

fn default() -> Self

Returns the “default value” for a type. 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<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.