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
//! # TurboKV
//!
//! A fast, embedded key-value store with a BTreeMap-like API.
//!
//! TurboKV achieves **2x faster** durable writes than RocksDB and fjall through
//! careful optimization. See the [`optimizations`] module for details.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use turbokv::{Db, DbOptions};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let db = Db::open("./my_data").await?;
//!
//! db.insert(b"hello", b"world").await?;
//! db.insert(b"foo", b"bar").await?;
//!
//! if let Some(value) = db.get(b"hello").await? {
//! println!("Got: {:?}", String::from_utf8_lossy(&value));
//! }
//!
//! db.remove(b"hello").await?;
//!
//! for (key, value) in db.range(b"a", b"z").await? {
//! println!("{:?} -> {:?}", key, value);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Durability Modes
//!
//! ```rust,no_run
//! use turbokv::{Db, DbOptions};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Fast: no WAL, no fsync (for caches, temporary data)
//! let db = Db::open_with_options("./data", DbOptions::fast()).await?;
//!
//! // Durable: WAL enabled, periodic sync (survives process crash)
//! let db = Db::open_with_options("./data", DbOptions::durable()).await?;
//!
//! // Paranoid: WAL + fsync every write (survives power loss)
//! let db = Db::open_with_options("./data", DbOptions::paranoid()).await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Batch Operations
//!
//! ```rust,no_run
//! use turbokv::{Db, WriteBatch};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let db = Db::open("./data").await?;
//!
//! let mut batch = WriteBatch::new();
//! batch.put(b"key1", b"value1");
//! batch.put(b"key2", b"value2");
//! batch.delete(b"old_key");
//! db.write_batch(&batch).await?;
//! # Ok(())
//! # }
//! ```
// Primary API
pub use ;
pub use ;
pub use ;
// Advanced API
pub use ;
pub use CompactionConfig;
pub use ;
pub use ;
pub use ;
pub use ;
/// Library version.
pub const VERSION: &str = env!;