Skip to main content

content_addressable/
structures.rs

1//! The Merkle structure catalog — the sub-manifest that keeps the crate root
2//! bounded as the catalog grows (epic #30).
3//!
4//! # Invariant: adding a structure never touches `src/lib.rs`
5//!
6//! Each catalog structure (Merkle Mountain Range, hash chain, sparse Merkle
7//! tree, Merkle-clock, …) is a feature-gated module declared **here**, in a
8//! sibling file `src/structures/<name>.rs`. The crate root carries a single
9//! `pub mod structures;` line and nothing per structure, so `lib.rs` stays a
10//! fixed-size manifest while this file absorbs the O(N) growth of the catalog.
11//!
12//! Structures are reached at their path
13//! (`content_addressable::structures::mmr::Mmr`) and are **not** flattened into
14//! the frozen crate-root facade — the minimal-surface principle applied to the
15//! public API, so the root's stable spine does not grow with the catalog.
16//!
17//! See `WORKSPACE_RULES.md` → "Composition roots are manifests, not members".
18//!
19//! Members land here as their issues do. So far: `dir_tree` (#105, behind the
20//! default-off `dir-tree` feature). Next are #45 (Merkle Mountain Range), #56
21//! (Merkle-clock), and the rest of the Phase 2+ catalog. Each registers with a
22//! one-line edit to *this* file, never the crate root.
23//!
24//! ```text
25//! // when #45 lands, it adds exactly one line here:
26//! #[cfg(feature = "mmr")]
27//! pub mod mmr;
28//! ```
29
30#[cfg(feature = "dir-tree")]
31pub mod dir_tree;