Expand description
sled
is a flash-sympathetic persistent lock-free B+ tree.
§Examples
let config = sled::ConfigBuilder::new().temporary(true).build();
let t = sled::Tree::start(config).unwrap();
t.set(b"yo!".to_vec(), b"v1".to_vec());
assert_eq!(t.get(b"yo!"), Ok(Some(b"v1".to_vec())));
t.cas(
b"yo!".to_vec(), // key
Some(b"v1".to_vec()), // old value, None for not present
Some(b"v2".to_vec()), // new value, None for delete
).unwrap();
let mut iter = t.scan(b"a non-present key before yo!");
assert_eq!(iter.next(), Some(Ok((b"yo!".to_vec(), b"v2".to_vec()))));
assert_eq!(iter.next(), None);
t.del(b"yo!");
assert_eq!(t.get(b"yo!"), Ok(None));
Structs§
- A finalized
ConfigBuilder
that can be use multiple times to open aTree
orLog
. - Top-level configuration for the system.
- atomic lock-free tree An iterator over keys and values in a
Tree
. - atomic lock-free tree A flash-sympathetic persistent lock-free B+ tree
Enums§
- An Error type encapsulating various issues that may come up in both the expected and unexpected operation of a PageCache.
Type Aliases§
- The top-level result type for dealing with the PageCache.