nb_tree/lib.rs
1//! # Node & Branch Tree
2//! This library provides tools to represent tree data with data associated to nodes and branches.
3//! The trees are stored in a simple dynamic array (Vec) data structure.
4//!
5//! The main data structures are [`Tree`] and [`Path`] to build data trees and path to tree nodes.
6//! The goal of this crate is to provide simple yet flexible structures that allow for custom node and branch types, tree building, diffing and patching.
7//!
8//! For more information about Trees and their usage,
9//! see the [module level documentation](crate::tree).
10//!
11//! # What it is
12//! A data structure to store and manipulate tree like data.
13//!
14//! # Properties
15//!
16//! The structure is an arborescence: it is directed, with nodes linking to their children.
17//!
18//! [`Tree`]: crate::tree::Tree
19//! [`Path`]: crate::path::Path
20
21// TODO
22// //! The need for such types for the [retracer](https://crates.io/crates/retracer/) library was the initial motivation to create this library.
23
24/// Macros to build trees and paths
25#[macro_use]
26mod macros;
27/// Structures to describe a position in a [`Tree`].
28///
29/// [`Tree`]: crate::tree::Tree
30pub mod path;
31/// Structures to build and manipulate [`Tree`]s.
32///
33/// [`Tree`]: crate::tree::Tree
34pub mod tree;
35
36/// The [`nb_tree`] Prelude.
37///
38/// [`nb_tree`]: crate
39pub mod prelude {
40 //! A collection of all major structures of the library.
41 pub use crate::{
42 path::Path,
43 tree::{
44 entry::Entry, iter, CombinationMode, DiffMap, DiffNode, DiffTree, Tree, TreeBuilder,
45 },
46 };
47}