Module darkfi_sdk::dark_tree

source ·
Expand description

DarkTree structures

Structs§

  • This struct represents a Forest of DarkTree. It is advised to always execute .build() after finishing setting up the Forest, to properly index it and check its integrity.
  • This struct represents the information hold by a DarkTreeLeaf, namely its data, along with positional indexes information, based on tree’s traversal order. These indexes are only here to enable referencing connected nodes, and are not used as pointers by the tree. Creator must ensure they are properly setup.
  • This struct represents a Tree using DFS post-order traversal, where when we iterate through the tree, we first process tree node’s children, and then the node itself, recursively. Based on this, initial tree node (leaf), known as the root, will always show up at the end of iteration. It is advised to always execute .build() after finishing setting up the Tree, to properly index it and check its integrity.
  • Special iterator of a DarkTree, performing DFS post-order traversal on the Tree leafs, consuming each leaf. Since this iterator consumes the tree, it becomes unusable after it’s moved.
  • Immutable iterator of a DarkTree, performing DFS post-order traversal on the Tree leafs.
  • Mutable iterator of a DarkTree, performing DFS post-order traversal on the Tree leafs.
  • This struct represents a Leaf of a DarkTree, holding this tree node data, along with its positional index, based on tree’s traversal order.

Functions§