pub struct MkTree<T: Entity>(pub TreeNode<T>, pub Vec<MkTree<T>>);
Expand description
Recursive tree struct.
Tuple Fields§
§0: TreeNode<T>
§1: Vec<MkTree<T>>
Implementations§
Source§impl<T: Entity> MkTree<T>
impl<T: Entity> MkTree<T>
Sourcepub fn node_name(&self) -> String
pub fn node_name(&self) -> String
Can be used to sort trees after construction. Must clone to get around the borrow checker.
Sourcepub fn leaf_group(group: &str, leaves: Vec<T>, typ: &ProjectSource) -> Self
pub fn leaf_group(group: &str, leaves: Vec<T>, typ: &ProjectSource) -> Self
The given group name will be made into a SubTreeRoot
directly containing the given leaves.
pub fn subtree_group( group: &str, subtrees: Vec<MkTree<T>>, typ: &ProjectSource, ) -> Self
Sourcepub fn from_node_n_leaves(entity: T, leaves: Vec<T>) -> Self
pub fn from_node_n_leaves(entity: T, leaves: Vec<T>) -> Self
A root and all other leaves at the same level.
pub fn from_node_n_subtrees(entity: T, subtrees: Vec<MkTree<T>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MkTree<T>where
T: Freeze,
impl<T> RefUnwindSafe for MkTree<T>where
T: RefUnwindSafe,
impl<T> Send for MkTree<T>where
T: Send,
impl<T> Sync for MkTree<T>where
T: Sync,
impl<T> Unpin for MkTree<T>where
T: Unpin,
impl<T> UnwindSafe for MkTree<T>where
T: 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