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
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.
Implementations§
Source§impl PaneNode
impl PaneNode
Sourcepub fn leaf(idx: usize) -> PaneNode
pub fn leaf(idx: usize) -> PaneNode
Leaf-only constructor used at App init when there’s exactly one pane.
Sourcepub fn is_single_leaf(&self) -> bool
pub fn is_single_leaf(&self) -> bool
True for the trivial single-leaf tree.
Sourcepub fn for_each_leaf(&self, visit: &mut impl FnMut(usize))
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§
Auto Trait Implementations§
impl Freeze for PaneNode
impl RefUnwindSafe for PaneNode
impl Send for PaneNode
impl Sync for PaneNode
impl Unpin for PaneNode
impl UnsafeUnpin for PaneNode
impl UnwindSafe for PaneNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more