1#![doc(
36 html_logo_url = "https://raw.githubusercontent.com/structured-world/coordinode-lsm-tree/main/logo.png"
37)]
38#![doc(
39 html_favicon_url = "https://raw.githubusercontent.com/structured-world/coordinode-lsm-tree/main/logo.png"
40)]
41#![deny(clippy::all, missing_docs, clippy::cargo)]
42#![deny(clippy::unwrap_used)]
43#![deny(clippy::indexing_slicing)]
44#![warn(clippy::pedantic, clippy::nursery)]
45#![warn(clippy::expect_used)]
46#![allow(clippy::missing_const_for_fn)]
47#![warn(clippy::multiple_crate_versions)]
48#![allow(clippy::option_if_let_else)]
49#![warn(clippy::redundant_feature_names)]
50#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
51
52#[doc(hidden)]
53pub type HashMap<K, V> = std::collections::HashMap<K, V, rustc_hash::FxBuildHasher>;
54
55pub(crate) type HashSet<K> = std::collections::HashSet<K, rustc_hash::FxBuildHasher>;
56
57macro_rules! fail_iter {
58 ($e:expr) => {
59 match $e {
60 Ok(v) => v,
61 Err(e) => return Some(Err(e.into())),
62 }
63 };
64}
65
66macro_rules! unwrap {
67 ($x:expr) => {{ $x.expect("should read") }};
68}
69
70mod any_tree;
71
72mod abstract_tree;
73
74#[doc(hidden)]
75pub mod blob_tree;
76
77mod comparator;
78
79#[doc(hidden)]
80mod cache;
81
82#[doc(hidden)]
83pub mod checksum;
84
85#[doc(hidden)]
86pub mod coding;
87
88pub mod compaction;
89#[doc(hidden)]
90pub mod compression;
91
92pub mod encryption;
94
95pub mod config;
97
98#[doc(hidden)]
99pub mod descriptor_table;
100
101#[doc(hidden)]
102pub mod file_accessor;
103
104mod double_ended_peekable;
105mod error;
106
107#[doc(hidden)]
108pub mod file;
109
110pub mod fs;
112
113mod hash;
114mod heap;
115mod ingestion;
116mod iter_guard;
117mod key;
118mod key_range;
119mod manifest;
120mod memtable;
121mod merge_operator;
122mod run_reader;
123mod run_scanner;
124
125#[doc(hidden)]
126pub mod merge;
127
128#[cfg(feature = "metrics")]
129pub(crate) mod metrics;
130
131#[doc(hidden)]
134pub mod mvcc_stream;
135
136mod path;
137mod pinnable_slice;
138mod prefix;
139
140#[doc(hidden)]
141pub mod range;
142
143pub(crate) mod active_tombstone_set;
144pub(crate) mod range_tombstone;
145pub(crate) mod range_tombstone_filter;
146
147#[doc(hidden)]
148pub mod table;
149
150mod seqno;
151mod slice;
152mod slice_windows;
153
154#[doc(hidden)]
155pub mod stop_signal;
156
157mod format_version;
158mod time;
159mod tree;
160
161pub mod util;
163
164mod value;
165mod value_type;
166mod write_batch;
167
168pub mod verify;
170
171mod version;
172mod vlog;
173
174pub type UserKey = Slice;
176
177pub type UserValue = Slice;
179
180pub type KvPair = (UserKey, UserValue);
182
183#[doc(hidden)]
184pub use {
185 blob_tree::{Guard as BlobGuard, handle::BlobIndirection},
186 checksum::Checksum,
187 iter_guard::IterGuardImpl,
188 key_range::KeyRange,
189 merge::BoxedIterator,
190 slice::Builder,
191 table::{GlobalTableId, Table, TableId},
192 tree::Guard as StandardGuard,
193 tree::inner::TreeId,
194 value::InternalValue,
195};
196
197pub use encryption::EncryptionProvider;
198
199#[cfg(feature = "encryption")]
200pub use encryption::Aes256GcmProvider;
201
202pub use pinnable_slice::PinnableSlice;
203pub use write_batch::WriteBatch;
204
205pub use {
206 abstract_tree::AbstractTree,
207 any_tree::AnyTree,
208 blob_tree::BlobTree,
209 cache::Cache,
210 comparator::{DefaultUserComparator, SharedComparator, UserComparator},
211 compression::CompressionType,
212 config::{Config, KvSeparationOptions, TreeType},
213 descriptor_table::DescriptorTable,
214 error::{Error, Result},
215 format_version::FormatVersion,
216 ingestion::AnyIngestion,
217 iter_guard::IterGuard as Guard,
218 memtable::{Memtable, MemtableId},
219 merge_operator::MergeOperator,
220 prefix::PrefixExtractor,
221 seqno::{
222 MAX_SEQNO, SequenceNumberCounter, SequenceNumberGenerator, SharedSequenceNumberGenerator,
223 },
224 slice::Slice,
225 tree::Tree,
226 value::SeqNo,
227 value_type::ValueType,
228 vlog::BlobFile,
229};
230
231#[cfg(zstd_any)]
232pub use compression::ZstdDictionary;
233
234#[cfg(feature = "metrics")]
235pub use metrics::Metrics;
236
237#[doc(hidden)]
238#[must_use]
239#[allow(missing_docs, clippy::missing_errors_doc, clippy::unwrap_used)]
240pub fn get_tmp_folder() -> tempfile::TempDir {
241 if let Ok(p) = std::env::var("LSMT_TMP_FOLDER") {
242 tempfile::tempdir_in(p)
243 } else {
244 tempfile::tempdir()
245 }
246 .unwrap()
247}