2 releases
Uses old Rust 2015
0.1.1 | Dec 6, 2017 |
---|---|
0.1.0 | Oct 20, 2017 |
#2351 in Database interfaces
47 downloads per month
Used in noise_search
9MB
196K
SLoC
rust-rocksdb
Feedback and pull requests welcome! If a particular feature of RocksDB is important to you, please let me know by opening an issue, and I'll prioritize it.
[dependencies]
rocksdb = "0.6.0"
This binding is statically linked with a specific version of RocksDB. If you want to build it yourself, make sure you've also cloned the RocksDB and Snappy submodules:
git submodule update --init --recursive
lib.rs
:
Rust wrapper for RocksDB.
Examples
use rocksdb::DB;
// NB: db is automatically closed at end of lifetime
let db = DB::open_default("path/for/rocksdb/storage").unwrap();
db.put(b"my key", b"my value");
match db.get(b"my key") {
Ok(Some(value)) => println!("retrieved value {}", value.to_utf8().unwrap()),
Ok(None) => println!("value not found"),
Err(e) => println!("operational problem encountered: {}", e),
}
db.delete(b"my key").unwrap();