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) -> Self
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>
impl<D: Eq> Eq for TreeLayout<D>
impl<D> StructuralPartialEq for TreeLayout<D>
Auto Trait Implementations§
impl<D> Freeze for TreeLayout<D>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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