From 705420aa692563aa795904dc67e5aab5e1344233 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sat, 7 Nov 2015 16:30:03 -0800 Subject: [PATCH] Update readme, bump version. --- Cargo.toml | 2 +- README.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 894a6f7..bed6a80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "rocksdb" description = "A Rust wrapper for Facebook's RocksDB embeddable database." -version = "0.1.1" +version = "0.2.0" authors = ["Tyler Neely ", "David Greenberg "] license = "Apache-2.0" keywords = ["database", "embedded", "LSM-tree", "persistence"] diff --git a/README.md b/README.md index baa2f63..4d4bd49 100644 --- a/README.md +++ b/README.md @@ -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) [![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.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 - [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] snapshot - [x] column family operations + - [ ] prefix seek - [ ] slicetransform - [ ] windows support @@ -35,7 +36,7 @@ sudo make install ###### Cargo.toml ```rust [dependencies] -rocksdb = "~0.1.1" +rocksdb = "~0.2.0" ``` ###### Code ```rust @@ -45,12 +46,11 @@ use rocksdb::{DB, Writable}; fn main() { let mut db = DB::open_default("/path/for/rocksdb/storage").unwrap(); db.put(b"my key", b"my value"); - db.get(b"my key") - .map( |value| { - println!("retrieved value {}", value.to_utf8().unwrap()) - }) - .on_absent( || { println!("value not found") }) - .on_error( |e| { println!("operational problem encountered: {}", e) }); + 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"); } @@ -141,7 +141,7 @@ fn main() { db.merge(b"k1", b"d"); db.merge(b"k1", b"efg"); let r = db.get(b"k1"); - assert!(r.unwrap().to_utf8().unwrap() == "abcdefg"); + assert!(r.unwrap().unwrap().to_utf8().unwrap() == "abcdefg"); } ```