pub fn get_tree(mana_dir: &Path, root_id: &str) -> Result<TreeNode, Error>Expand description
Build a unit hierarchy tree rooted at the given unit ID.
Returns a TreeNode with all descendants nested recursively. Only units
in the active index are included (archived units are excluded).
§Errors
ManaError::UnitNotFound— no unit with the given ID in the active indexManaError::IndexError— index cannot be loaded
§Example
use mana_core::api::get_tree;
use std::path::Path;
let tree = get_tree(Path::new("/project/.mana"), "1").unwrap();
println!("{}: {} children", tree.id, tree.children.len());