Struct tree_layout::TreeLayout
source · pub struct TreeLayout<D> { /* private fields */ }
Implementations§
source§impl<D> TreeLayout<D>
impl<D> TreeLayout<D>
pub fn new<F, N, T>(user_tree: &T, root: N, data: F) -> Selfwhere F: Fn(&T, N) -> D, N: Clone, T: NodeInfo<N>,
pub fn root(&self) -> Option<usize>
pub fn breadth_first(&self, node: usize) -> Vec<usize>
pub fn post_order(&self, node: usize) -> Vec<usize>
pub fn left_siblings(&self, node: usize) -> Vec<usize>
pub fn siblings_between(&self, left: usize, right: usize) -> Vec<usize>
pub fn previous_sibling(&self, node: usize) -> Option<usize>
pub fn find_parent(&self, node: &TreeNode<D>) -> Option<&TreeNode<D>>
Trait Implementations§
source§impl<D: Clone> Clone for TreeLayout<D>
impl<D: Clone> Clone for TreeLayout<D>
source§fn clone(&self) -> TreeLayout<D>
fn clone(&self) -> TreeLayout<D>
Returns a copy 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 moresource§impl<D: Debug> Debug for TreeLayout<D>
impl<D: Debug> Debug for TreeLayout<D>
source§impl<D> Default for TreeLayout<D>
impl<D> Default for TreeLayout<D>
source§impl<D> Index<usize> for TreeLayout<D>
impl<D> Index<usize> for TreeLayout<D>
source§impl<D> IndexMut<usize> for TreeLayout<D>
impl<D> IndexMut<usize> for TreeLayout<D>
source§impl<D> IntoIterator for TreeLayout<D>
impl<D> IntoIterator for TreeLayout<D>
source§impl<D: PartialEq> PartialEq for TreeLayout<D>
impl<D: PartialEq> PartialEq for TreeLayout<D>
source§fn eq(&self, other: &TreeLayout<D>) -> bool
fn eq(&self, other: &TreeLayout<D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<D: Eq> Eq for TreeLayout<D>
impl<D> StructuralEq for TreeLayout<D>
impl<D> StructuralPartialEq for TreeLayout<D>
Auto Trait Implementations§
impl<D> RefUnwindSafe for TreeLayout<D>where D: RefUnwindSafe,
impl<D> Send for TreeLayout<D>where D: Send,
impl<D> Sync for TreeLayout<D>where D: Sync,
impl<D> Unpin for TreeLayout<D>where D: Unpin,
impl<D> UnwindSafe for TreeLayout<D>where D: 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