A collection of embedded, thread-safe key-value stores in Rust.
The caves
crate provides a selection of key-value stores with the
following features:
For more info, read...
```rust use caves::errors::Error; use caves::{MemoryCave, Cave};
// Initialize a MemoryCave object. let b = MemoryCave::new();
// Create a new key with an empty value. b.set("key", b"");
// Override the key's value. b.set("key", b"value");
// Retrieve the contents of the key. let res = b.get("key"); assert_eq!(res.unwrap(), b"value");
// Delete the key. b.delete("key");
// Subsequent attempts to retrieve the contents of the key should return an // error. let res = b.get("key"); asserteq!(res, Err(Error::NotFound("key".tostring()))); ```
You can read the latest docs in https://docs.rs/caves.
Clone this repo, make changes to the code and ensure that the tests pass:
$ cargo test
Finally, read the [NOTICE.md
] file for the legal status of the project.
Licensed under MPL-2.0. Please read the [NOTICE.md
] and [LICENSE
] files for
the full copyright and license information.