generic-tree 0.2.0

A very simple, intuitive API for storing data in a tree-like structure.
Documentation
  • Coverage
  • 89.47%
    17 out of 19 items documented14 out of 18 items with examples
  • Size
  • Source code size: 19.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.18 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • seirdb
generic-tree-0.2.0 has been yanked.

generic-tree

Regression License Documentation

This crate provides a very simple, intuitive API for storing data in a tree-like structure.

Example

To get started, add the following to Cargo.toml.

generic-tree = "0.1"
use generic_tree::{Tree, Node};

struct Data;

fn main() {

    // Create a root Node
    let mut root = Node::new("root", Data);

    // Create a tree from it
    let mut tree = Tree::init(root);

    // Create a child
    let child = Node::new("child", Data);

    // And add it as a child of `root`
    tree.add_node(&["root"], child);

    // Get a reference to the child
    let child = tree.get_node(&["root", "child"]).unwrap();
}