This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.1.1 crate should work with the Rust 1.2 stable and nightly releases as of 9/7/15.
This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.2.0 crate should work with the Rust 1.4 stable and nightly releases as of 11/7/15.
### status
### status
- [x] basic open/put/get/delete/close
- [x] basic open/put/get/delete/close
@ -16,6 +16,7 @@ This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.1.1
- [x] comparator
- [x] comparator
- [x] snapshot
- [x] snapshot
- [x] column family operations
- [x] column family operations
- [ ] prefix seek
- [ ] slicetransform
- [ ] slicetransform
- [ ] windows support
- [ ] windows support
@ -35,7 +36,7 @@ sudo make install
###### Cargo.toml
###### Cargo.toml
```rust
```rust
[dependencies]
[dependencies]
rocksdb = "~0.1.1"
rocksdb = "~0.2.0"
```
```
###### Code
###### Code
```rust
```rust
@ -45,12 +46,11 @@ use rocksdb::{DB, Writable};
fn main() {
fn main() {
let mut db = DB::open_default("/path/for/rocksdb/storage").unwrap();
let mut db = DB::open_default("/path/for/rocksdb/storage").unwrap();
db.put(b"my key", b"my value");
db.put(b"my key", b"my value");
db.get(b"my key")
match db.get(b"my key") {
.map( |value| {
Ok(Some(value)) => println!("retrieved value {}", value.to_utf8().unwrap()),
println!("retrieved value {}", value.to_utf8().unwrap())
Ok(None) => println!("value not found"),
})
Err(e) => println!("operational problem encountered: {}", e),
.on_absent( || { println!("value not found") })
}
.on_error( |e| { println!("operational problem encountered: {}", e) });