Export SubDBIterator

master
Tyler Neely 9 years ago
parent 29fa2368d9
commit b4c3f3ab2f
  1. 2
      Cargo.toml
  2. 4
      README.md
  3. 2
      src/lib.rs
  4. 6
      src/main.rs

@ -2,7 +2,7 @@
name = "rocksdb" name = "rocksdb"
description = "A Rust wrapper for Facebook's RocksDB embeddable database." description = "A Rust wrapper for Facebook's RocksDB embeddable database."
version = "0.2.0" version = "0.2.1"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"] authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
license = "Apache-2.0" license = "Apache-2.0"
keywords = ["database", "embedded", "LSM-tree", "persistence"] keywords = ["database", "embedded", "LSM-tree", "persistence"]

@ -3,7 +3,7 @@ rust-rocksdb
[![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb) [![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb)
[![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb) [![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb)
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. This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.2.1 crate should work with the Rust 1.4 stable and nightly releases as of 11/15/15.
### status ### status
- [x] basic open/put/get/delete/close - [x] basic open/put/get/delete/close
@ -36,7 +36,7 @@ sudo make install
###### Cargo.toml ###### Cargo.toml
```rust ```rust
[dependencies] [dependencies]
rocksdb = "0.2.0" rocksdb = "0.2.1"
``` ```
###### Code ###### Code
```rust ```rust

@ -15,7 +15,7 @@
// //
pub use ffi as rocksdb_ffi; pub use ffi as rocksdb_ffi;
pub use ffi::{DBCompactionStyle, DBComparator, new_bloom_filter}; pub use ffi::{DBCompactionStyle, DBComparator, new_bloom_filter};
pub use rocksdb::{DB, DBVector, Direction, Writable, WriteBatch}; pub use rocksdb::{DB, DBIterator, DBVector, Direction, SubDBIterator, Writable, WriteBatch};
pub use rocksdb_options::{BlockBasedOptions, Options}; pub use rocksdb_options::{BlockBasedOptions, Options};
pub use merge_operator::MergeOperands; pub use merge_operator::MergeOperands;
pub mod rocksdb; pub mod rocksdb;

@ -57,9 +57,9 @@ fn main() {
Some(v) => println!("retrieved utf8 value: {}", v), Some(v) => println!("retrieved utf8 value: {}", v),
None => println!("did not read valid utf-8 out of the db"), None => println!("did not read valid utf-8 out of the db"),
} }
} },
Ok(None) => panic!("value not present!"),
Err(e) => println!("error retrieving value: {}", e), Err(e) => println!("error retrieving value: {}", e),
_ => panic!("value not present!"),
} }
assert!(db.delete(b"my key").is_ok()); assert!(db.delete(b"my key").is_ok());
@ -106,8 +106,8 @@ fn custom_merge() {
None => println!("did not read valid utf-8 out of the db"), None => println!("did not read valid utf-8 out of the db"),
} }
} }
Ok(None) => panic!("value not present!"),
Err(e) => println!("error retrieving value: {}", e), Err(e) => println!("error retrieving value: {}", e),
_ => panic!("value not present!"),
} }
} }
DB::destroy(&opts, path).is_ok(); DB::destroy(&opts, path).is_ok();

Loading…
Cancel
Save