1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
//! # holt — adaptive radix tree metadata storage engine
//!
//! `holt` is an embedded Rust library that stores **path-shaped
//! metadata** with sub-microsecond lookups, per-blob concurrency,
//! and crash-safe persistence. It is built around an Adaptive
//! Radix Tree that spans multiple 512 KB blob frames.
//!
//! See `README.md` for the elevator pitch and `ARCHITECTURE.md`
//! for the deep dive.
//!
//! ## Current status
//!
//! All core layers — layout, walker (insert / lookup / erase /
//! range / spillover / compact / merge), persistent backend
//! (`O_DIRECT` + optional `io_uring`), WAL with replay, sharded
//! buffer manager, background checkpointer — are in place and
//! covered by integration + property tests. See `ROADMAP.md`
//! for the post-0.3 direction.
//!
//! ## Quick taste
//!
//! ```ignore
//! use holt::{RangeEntry, TreeBuilder};
//!
//! let tree = TreeBuilder::new("/var/lib/myapp/meta.holt").open()?;
//! tree.put(b"img/01.jpg", b"rgb_data")?;
//! let v: Vec<u8> = tree.get(b"img/01.jpg")?.unwrap();
//! for entry in tree.scan_prefix(b"img/").into_iter().take(10) {
//! if let RangeEntry::Key { key, value } = entry? {
//! println!("{key:?} -> {value:?}");
//! }
//! }
//! # Ok::<(), holt::Error>(())
//! ```
//!
//! ## Module map
//!
//! Public modules (the supported, SemVer-committed import surface):
//!
//! - [`api`] — high-level [`Tree`] + [`TxnBatch`] +
//! [`TreeBuilder`], plus the curated [`api::range`] /
//! [`api::stats`] re-export modules.
//!
//! Everything else is `pub(crate)`. The user surface is
//! deliberately narrow so the on-disk format, WAL record codec,
//! and buffer-manager internals are free to change in minor
//! releases without breaking downstream code. Only the
//! crate-root re-exports below are SemVer-stable.
//!
//! Internal modules (`pub(crate)`, not part of the SemVer surface):
//!
//! - `layout` — extern struct layouts (BlobHeader, SlotEntry,
//! per-NodeType bodies). Pinned at compile time via
//! `const _: () = assert!(...)` blocks per file.
//! - `journal` — WAL codec + replay scanner + writer.
//! - `store` — buffer manager + blob-frame allocator + backend
//! trait machinery. The supported backend surface
//! ([`Backend`], [`MemoryBackend`], [`PersistentBackend`],
//! [`AlignedBlobBuf`]) is re-exported at the crate root for
//! users who want to plug in a custom backend.
//! - `engine` — recursive walker (insert / lookup / erase /
//! scan / rename / compact). Its public types (range iterators,
//! stats) are re-exported via [`api::range`] / [`api::stats`].
//! - `concurrency` — `HybridLatch` 3-mode lock plus the
//! tree-wide maintenance gate.
//! - `checkpoint` — 3-thread background checkpointer. Users opt
//! in via [`CheckpointConfig`].
//!
//! ## Platform support
//!
//! holt is **Unix-only by design**: Linux (`O_DIRECT` fast path,
//! `io_uring` on the persistent backend) and macOS (`F_NOCACHE`).
//! Windows is out of scope and the crate refuses to compile there
//! — see the platform stance in `ROADMAP.md`.
// `clippy::pedantic` opt-in is on purpose — we want the high
// signal-to-noise lints firing. The blanket allows below are
// the categories we've reviewed and judged to be either
// intentional design choices in this crate or stylistic
// preferences that don't carry their weight here.
// Hard scope gate — see the "Platform support" section in the
// module docs. Building holt for Windows is intentionally
// unsupported; the persistent backend's `O_DIRECT` / `F_NOCACHE`
// path has no Windows analog worth maintaining for this project.
compile_error!;
pub
pub
pub
pub
pub
pub
/// Prometheus text-format renderer for [`TreeStats`]. Enabled via
/// the `metrics` feature flag.
// -- Top-level re-exports -----------------------------------------
//
// The flat `holt::*` surface — every name a user reaches for via
// `use holt::X` lives here. Module-pathed access (e.g.
// `holt::api::stats::TreeStats`) still works for users who prefer
// it.
// Core handle + configuration.
pub use TreeBuilder;
pub use ;
pub use ;
pub use Tree;
// Range-scan iterator surface.
pub use ;
// Stats snapshots returned by `Tree::stats`.
pub use ;
// Single-record batched transactions.
pub use TxnBatch;
// Background checkpointer policy. The `Checkpointer` handle
// itself is crate-internal; users opt in via this config.
pub use CheckpointConfig;
// Backend trait + bundled backends + zero-copy blob buffer.
// Users implementing a custom `Backend` need `BlobGuid` to name
// the blob they're storing.
pub use BlobGuid;
pub use ;