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. - Struct representing the information hold by a
DarkTreeLeaf
. - This struct represents a DFS post-order traversal Tree.
- 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§
- Check
DarkLeaf
children indexes validity - Auxiliary function to verify provided
DarkLeaf
slice, representing the leafs of aDarkForest
, is properly bounded and its members indexes are valid. Slice must contain at least 1 leaf. - Auxiliary function to verify provided
DarkLeaf
slice is properly bounded and its members indexes are valid. Optionally, an offset can be provided in case leaf indexes are known to be shifted.