| Crates.io | rocksbin |
| lib.rs | rocksbin |
| version | 0.3.0 |
| created_at | 2018-11-28 20:23:58.628116+00 |
| updated_at | 2019-01-31 15:48:33.320211+00 |
| description | A simple rocksdb wrapper using serde and bincode for automatic serialization |
| homepage | https://github.com/birktj/rocksbin-db |
| repository | https://github.com/birktj/rocksbin-db |
| max_upload_size | |
| id | 99136 |
| size | 27,422 |
A simple rust rocksdb wrapper using serde and bincode for automatic serialization.
This library is perfect if what you want is a persistent HashMap stored on disk and a simple API.
extern crate rocksbin;
use rocksbin::DB;
let db = DB::open("db_dir").unwrap();
let fish_count = db.prefix::<String, u64>(b"fish_count").unwarp();
fish_count.insert("salmon", 10).unwarp();
fish_count.insert("cod", 100).unwarp();
fish_count.insert("mackerel", 70).unwarp();
assert_eq!(fish_count.get("salmon").unwarp(), Some(10));