pub enum LayoutNode {
Leaf(PaneId),
Split {
direction: SplitDirection,
ratio: f32,
first: Box<LayoutNode>,
second: Box<LayoutNode>,
},
}Expand description
A node in the binary layout tree.
Variants§
Implementations§
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn pane_ids(&self) -> Vec<PaneId> ⓘ
pub fn pane_ids(&self) -> Vec<PaneId> ⓘ
Collect all pane IDs in this subtree (left-to-right / top-to-bottom order).
Sourcepub fn swap_leaves(&mut self, a: PaneId, b: PaneId) -> bool
pub fn swap_leaves(&mut self, a: PaneId, b: PaneId) -> bool
Swap two leaf pane IDs in the tree.
Sourcepub fn replace_leaf(&mut self, old_id: PaneId, new_id: PaneId) -> bool
pub fn replace_leaf(&mut self, old_id: PaneId, new_id: PaneId) -> bool
Replace a leaf’s pane ID with a new ID.
Sourcepub fn find_position(
&self,
target: PaneId,
col: usize,
row: usize,
cols: usize,
rows: usize,
) -> Option<PanePosition>
pub fn find_position( &self, target: PaneId, col: usize, row: usize, cols: usize, rows: usize, ) -> Option<PanePosition>
Find the pane position for a specific pane given bounds.
Trait Implementations§
Source§impl Clone for LayoutNode
impl Clone for LayoutNode
Source§fn clone(&self) -> LayoutNode
fn clone(&self) -> LayoutNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LayoutNode
impl RefUnwindSafe for LayoutNode
impl Send for LayoutNode
impl Sync for LayoutNode
impl Unpin for LayoutNode
impl UnsafeUnpin for LayoutNode
impl UnwindSafe for LayoutNode
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
Mutably borrows from an owned value. Read more