encrypted-sled
encrypted-sled is an (almost) drop in replacement / wrapper around the amazing
sled embedded database. Just configure with an encryption
and use normally.
Examples
let cipher = ;
let db = open.unwrap;
// insert and get
db.insert;
assert_eq!;
// Atomic compare-and-swap.
db.compare_and_swap
.unwrap;
// Iterates over key-value pairs, starting at the given key.
let scan_key: & = b"a non-present key before yo!";
let mut iter = db.range.unwrap;
assert_eq!;
assert_eq!;
db.remove;
assert_eq!;
let other_tree = db.open_tree.unwrap;
other_tree.insert.unwrap;
Todos
A few things are still not implemented:
TransactionalTrees(e.g. performing a transaction on multiple trees at the same time)- Database import/export
A few functions don't handle encryption/decryption gracefully and therefore may cause corrupted data, so please use at your own risk! Encrypted keys will most likely break these
update_and_fetchandfetch_and_update- Merge operators
License: MIT