[−][src]Crate sled
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));
Structs
Config | A finalized |
ConfigBuilder | Top-level configuration for the system. |
Db | The |
Iter | An iterator over keys and values in a |
Subscriber | A subscriber listening on a specified prefix |
Tree | A flash-sympathetic persistent lock-free B+ tree |
Enums
Error | An Error type encapsulating various issues that may come up in both the expected and unexpected operation of a PageCache. |
Event | An event that happened to a key that a subscriber is interested in. |
IVec | A buffer that may either be inline or remote and protected by an Arc |
Type Definitions
Result | The top-level result type for dealing with the PageCache. |