Crate sled

source ·
Expand description

sled is a flash-sympathetic persistent lock-free B+ tree.


let t = sled::Tree::start_default("my_db").unwrap();

t.set(b"yo!", b"v1".to_vec());
assert!(t.get(b"yo!").unwrap().unwrap() == &*b"v1".to_vec());

    b"yo!",                // key
    Some(b"v1"),           // old value, None for not present
    Some(b"v2".to_vec()),  // new value, None for delete

let mut iter = t.scan(b"a non-present key before yo!");
// assert_eq!(, Some(Ok((b"yo!".to_vec(), b"v2".to_vec()))));
// assert_eq!(, None);

assert_eq!(t.get(b"yo!"), Ok(None));


A finalized ConfigBuilder that can be use multiple times to open a Tree or Log.
Top-level configuration for the system.
An iterator over keys and values in a Tree.
An iterator over keys in a Tree
A reference to a heap location that is guaranteed to be valid for as long as this value exists.
atomic lock-free tree A flash-sympathetic persistent lock-free B+ tree
An iterator over values in a Tree


An Error type encapsulating various issues that may come up in both the expected and unexpected operation of a PageCache.
An event that happened to a key that a subscriber is interested in.

Type Definitions

The top-level result type for dealing with the PageCache.