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
#![deny(missing_docs)]
#![cfg_attr(test, deny(clippy::warnings))]
#![cfg_attr(test, deny(clippy::bad_style))]
#![cfg_attr(test, deny(clippy::future_incompatible))]
#![cfg_attr(test, deny(clippy::nonstandard_style))]
#![cfg_attr(test, deny(clippy::rust_2018_compatibility))]
#![cfg_attr(test, deny(clippy::rust_2018_idioms))]
mod binary_search;
mod data;
mod db;
mod frag;
mod iter;
mod materializer;
mod meta;
mod node;
mod pinned_value;
mod prefix;
mod recovery;
mod subscription;
mod tree;
const META_PID: PageId = 0;
const COUNTER_PID: PageId = 1;
const DEFAULT_TREE_PID: PageId = 3;
const TX_TREE_PID: PageId = 5;
const DEFAULT_TREE_ID: &[u8] = b"__sled__default";
const TX_TREE_ID: &[u8] = b"__sled__transactions";
pub use {
self::{
db::Db,
iter::{Iter, Keys, Values},
pinned_value::PinnedValue,
subscription::{Event, Subscriber},
tree::Tree,
},
pagecache::{Config, ConfigBuilder, Error, Meta, Result},
};
use {
self::{
binary_search::{
binary_search_gt, binary_search_lt, binary_search_lub,
leaf_search,
},
data::Data,
frag::{ChildSplit, Frag, ParentSplit},
materializer::BLinkMaterializer,
node::Node,
prefix::{
prefix_cmp, prefix_cmp_encoded, prefix_decode,
prefix_encode,
},
recovery::Recovery,
subscription::Subscriptions,
},
log::{debug, error, trace},
pagecache::{
Materializer, Measure, MergeOperator, PageCache, PageGet,
PageId, M,
},
serde::{Deserialize, Serialize},
sled_sync::{debug_delay, pin, Guard},
};
type Key = Vec<u8>;
type KeyRef<'a> = &'a [u8];
type Value = Vec<u8>;
type TreePtr<'g> = pagecache::PagePtr<'g, Frag>;