pub struct Tree {
pub root_id: TreeNodeId,
/* private fields */
}
Expand description
Fields
root_id: TreeNodeId
Implementations
sourceimpl Tree
impl Tree
sourcepub fn arena(&self) -> RwLockReadGuard<'_, TreeArena>
pub fn arena(&self) -> RwLockReadGuard<'_, TreeArena>
Return the underlying tree arena.
sourcepub fn new_node(&self, node: Node) -> TreeNodeId
pub fn new_node(&self, node: Node) -> TreeNodeId
sourcepub fn add_child_from_id(&self, parent_id: NodeId, node_id: NodeId)
pub fn add_child_from_id(&self, parent_id: NodeId, node_id: NodeId)
sourcepub fn add_child(&self, parent_id: NodeId, node: Node) -> Result<TreeNodeId>
pub fn add_child(&self, parent_id: NodeId, node: Node) -> Result<TreeNodeId>
Create a new TreeNodeId for node
, add it as child of parent_id
and return the new node id
sourcepub fn children_id(&self, node_id: NodeId) -> Vec<NodeId>
pub fn children_id(&self, node_id: NodeId) -> Vec<NodeId>
Return the children of the provided NodeId as a Vector of NodeId.
sourcepub fn children(&self, node_id: NodeId) -> Vec<Arc<Node>>
pub fn children(&self, node_id: NodeId) -> Vec<Arc<Node>>
Return the children of the provided NodeId as a Vector of Node.
sourcepub fn children_rec(&self, root: Option<&str>) -> Option<Vec<TreeNodeId>>
pub fn children_rec(&self, root: Option<&str>) -> Option<Vec<TreeNodeId>>
Return children from a node root
path recusively as a Vec<TreeNodeId>.
sourcepub fn children_name(&self, node_id: NodeId) -> Vec<String>
pub fn children_name(&self, node_id: NodeId) -> Vec<String>
Return the name of the children for node_id
.
sourcepub fn has_children(&self, node_id: NodeId) -> bool
pub fn has_children(&self, node_id: NodeId) -> bool
Check if node as children.
sourcepub fn children_id_name(&self, node_id: NodeId) -> Vec<ChildInfo>
pub fn children_id_name(&self, node_id: NodeId) -> Vec<ChildInfo>
Return different info for all children of a node.
sourcepub fn get_node_from_id(&self, node_id: TreeNodeId) -> Option<TreeNode>
pub fn get_node_from_id(&self, node_id: TreeNodeId) -> Option<TreeNode>
sourcepub fn find_node_from_id(
&self,
from_id: TreeNodeId,
path: &str
) -> Option<TreeNodeId>
pub fn find_node_from_id(
&self,
from_id: TreeNodeId,
path: &str
) -> Option<TreeNodeId>
Search recursively for nodes matching path
, starting from the root from_id
.
sourcepub fn get_node_id(&self, pathes: &str) -> Option<TreeNodeId>
pub fn get_node_id(&self, pathes: &str) -> Option<TreeNodeId>
Return a node id from node path
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more