openmls/binary_tree/array_representation/
mod.rs

1//! This module implements a full, left-balanced binary tree using an array
2//! representation for storing and indexing nodes efficiently.
3//!
4//! # Overview
5//!
6//! The implementation is divided into a tree and a corresponding diff. The tree
7//! is immutable except for merging with a diff. The diff provides an API for
8//! mutating parts of the tree and navigating it using node references. See the
9//! [`tree`] and [`diff`] modules for detailed documentation.
10
11// Public
12pub use treemath::LeafNodeIndex;
13
14// Crate
15pub(crate) mod diff;
16pub(crate) mod sorted_iter;
17pub(crate) mod tree;
18
19pub(crate) use treemath::{
20    direct_path, is_node_in_tree, left, right, root, ParentNodeIndex, TreeNodeIndex, TreeSize,
21    MIN_TREE_SIZE,
22};
23
24#[cfg(any(feature = "test-utils", test))]
25pub(crate) use treemath::level;
26
27mod treemath;
28
29// Tests
30#[cfg(any(feature = "test-utils", test))]
31pub mod kat_treemath;