pub enum NaryNode<Id: Copy + Eq + Ord> {
Leaf(Id),
Container {
orientation: Orientation,
children: Vec<NaryNode<Id>>,
weights: Vec<u16>,
},
}Variants§
Implementations§
Source§impl<Id: Copy + Eq + Ord> NaryNode<Id>
impl<Id: Copy + Eq + Ord> NaryNode<Id>
pub fn leaf(id: Id) -> Self
pub fn is_leaf(&self) -> bool
pub fn unwrap_leaf(&self) -> Option<Id>
pub fn all_leaf_ids(&self) -> Vec<Id>
pub fn subtree_any(&self, predicate: &mut impl FnMut(Id) -> bool) -> bool
pub fn layout(&self, area: LayoutRect) -> Vec<(Id, LayoutRect)>
pub fn find_path(&self, target: Id) -> Option<Vec<usize>>
pub fn node_at_path(&self, path: &[usize]) -> Option<&Self>
pub fn node_at_path_mut(&mut self, path: &[usize]) -> Option<&mut Self>
pub fn layout_with_gaps( &self, area: LayoutRect, gap: u16, ) -> Vec<(Id, LayoutRect)>
pub fn split_area_for_path( &self, area: LayoutRect, path: &[usize], ) -> Option<LayoutRect>
pub fn insert_leaf( &mut self, target: Id, insert: Id, position: InsertPosition, area: LayoutRect, constraints: &SizeConstraints, ) -> Result<(), LayoutError>
pub fn apply_drag( &mut self, area: LayoutRect, path: &[usize], index: usize, orientation: Orientation, delta: i16, constraints: &SizeConstraints, ) -> bool
pub fn remove_leaf(&mut self, id: Id) -> Result<(), LayoutError>
Trait Implementations§
Source§impl<Id: Copy + Eq + Ord> LayoutEngine<Id> for NaryNode<Id>
impl<Id: Copy + Eq + Ord> LayoutEngine<Id> for NaryNode<Id>
fn layout(&self, area: LayoutRect) -> Vec<(Id, LayoutRect)>
fn insert_leaf( &mut self, target: Id, insert: Id, position: InsertPosition, area: LayoutRect, constraints: &SizeConstraints, ) -> Result<(), LayoutError>
fn remove_leaf(&mut self, id: Id) -> Result<(), LayoutError>
fn all_leaf_ids(&self) -> Vec<Id>
fn subtree_any(&self, predicate: &mut impl FnMut(Id) -> bool) -> bool
fn apply_drag( &mut self, area: LayoutRect, path: &[usize], index: usize, orientation: Orientation, delta: i16, constraints: &SizeConstraints, ) -> bool
Auto Trait Implementations§
impl<Id> Freeze for NaryNode<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for NaryNode<Id>where
Id: RefUnwindSafe,
impl<Id> Send for NaryNode<Id>where
Id: Send,
impl<Id> Sync for NaryNode<Id>where
Id: Sync,
impl<Id> Unpin for NaryNode<Id>where
Id: Unpin,
impl<Id> UnsafeUnpin for NaryNode<Id>where
Id: UnsafeUnpin,
impl<Id> UnwindSafe for NaryNode<Id>where
Id: UnwindSafe,
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