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
//! `novakv` — an embedded, ordered key-value store. Crate root.
//!
//! The headline entry point is [`db_impl::DBImpl`] — open a DB, run
//! `put` / `get` / `delete` / `write` / `new_iterator` /
//! `get_snapshot`. Most callers only need [`prelude`].
//!
//! # Layout
//!
//! Each public module is a focused layer of the storage engine. Every
//! module's `//!` doc explains what's there and when to reach for it.
//!
//! | Module | What's in it |
//! |--------|--------------|
//! | [`coding`] | varint + fixed-LE primitives |
//! | [`status`] | `Status`, `Code`, `Result` |
//! | [`hash`] | non-cryptographic 32-bit hash |
//! | [`crc32c`] | CRC32C + masked variant |
//! | [`comparator`] | `Comparator` trait + `BytewiseComparator` |
//! | [`format`](mod@format) | internal-key format, level constants |
//! | [`write_batch`] | `WriteBatch`, `WriteBatchHandler` |
//! | [`block`] | data-block builder + reader |
//! | [`filter`] | `FilterPolicy` + `BloomFilterPolicy` |
//! | [`filter_block`] | per-block filter index |
//! | [`two_level_iter`] | index-of-blocks iterator |
//! | [`merging_iter`] | k-way merge iterator |
//! | [`table`] | SSTable builder + reader + `Compressor` |
//! | [`log`] | WAL writer + reader |
//! | [`skiplist`] | lock-free skiplist |
//! | [`memtable`] | in-memory write buffer |
//! | [`filename`] | DB-directory file naming |
//! | [`env`](mod@env) | filesystem trait + `StdEnv` + `MemEnv` |
//! | [`cache`] | `Cache` trait + `ShardedLRUCache` |
//! | [`table_cache`] | open-Table cache |
//! | [`version_set`] | LSM level metadata + manifest |
//! | [`db_impl`] | `DBImpl`, `Options`, `ReadOptions`, `WriteOptions` |
//! | [`db_iter`] | snapshot-aware iterator |
//! | [`repair`] | reconstruct a damaged DB |
//! | [`destroy`] | delete a DB directory |
//! | [`slice`](mod@slice) | `(ptr, len)` byte view |
//!
//! # Quickstart
//!
//! ```
//! use novakv::prelude::*;
//!
//! let env = MemEnv::new();
//! let db = DBImpl::open("/db", env, BytewiseComparator, Options::default()).unwrap();
//! db.put(b"hello", b"world").unwrap();
//! assert_eq!(db.get(b"hello").unwrap(), Some(b"world".to_vec()));
//! ```
//!
//! See [`db_impl`] for the full API surface and tuning knobs.
// Each engine layer is a directory module whose primary file shares the
// directory name (`block/block.rs`); this layout is intentional.
/// Built-in Snappy block compressor. Available behind the `snappy`
/// Cargo feature.
pub use DbIterator;
pub use ;
pub use ;
pub use ;
pub use ;
/// Public-API surface. An embedder typically only needs the items in
/// this prelude — concrete types for opening / using / closing a
/// database, plus the trait that abstracts over `DBImpl`.
///
/// ```
/// use novakv::prelude::*;
/// // brings DBImpl, Options, ReadOptions, WriteOptions, Snapshot,
/// // BytewiseComparator, Comparator, Env, MemEnv, StdEnv, Status,
/// // Result, Code, Cache, CacheHandle, ShardedLRUCache, Compressor,
/// // FilterPolicy, BloomFilterPolicy, Logger, WriteBatch, ...
/// let _ = MemEnv::new();
/// ```