52 releases (10 breaking)

✓ Uses Rust 2018 edition

0.22.1 Apr 10, 2019
0.21.4 Apr 8, 2019
0.20.1 Mar 31, 2019
0.16.11 Dec 14, 2018
0.14.1 Sep 9, 2017

#11 in Database implementations

Download history 28/week @ 2018-12-26 103/week @ 2019-01-02 189/week @ 2019-01-09 112/week @ 2019-01-16 56/week @ 2019-01-23 53/week @ 2019-01-30 52/week @ 2019-02-06 48/week @ 2019-02-13 72/week @ 2019-02-20 198/week @ 2019-02-27 95/week @ 2019-03-06 109/week @ 2019-03-13 484/week @ 2019-03-20 306/week @ 2019-03-27 320/week @ 2019-04-03

698 downloads per month
Used in 8 crates (7 directly)

MIT/Apache

431KB
10K SLoC


lib.rs:

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

Examples

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

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

t.cas(
    b"yo!",                // key
    Some(b"v1"),           // 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));

Dependencies

~4.5MB
~85K SLoC