Skip to content

Custom (mutable) traversal is a bit hard. #159

Closed
@the-ssd

Description

@the-ssd

Currently, the best I was able to do is passing the tree as mutable, and NodeIdx

getting children is also a bit weird

let node = self.tree.get_node(&node_idx).unwrap();
let children_ids = node.children().map(|child| child.idx()).collect::<Vec<_>>();

let mut children = vec![];
for node in children_ids {
    let value = self.execute_rec(inputs, node);
    children.push(value);
}

let mut node = self.tree.get_node_mut(&node_idx).unwrap();
// Use children and node here

That being said, this is still a very useful create.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions