Skip to content

Commit 08a8192

Browse files
authored
Merge branch 'master' into asrefmut-from-traits-impls
2 parents c267045 + 4e9a42f commit 08a8192

File tree

13 files changed

+434
-192
lines changed

13 files changed

+434
-192
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ name = "tikv_client"
1515
futures = "0.1"
1616
serde = "1.0"
1717
serde_derive = "1.0"
18-
quick-error = "1.2"
1918
grpcio = { version = "0.4", features = [ "secure" ] }
2019
protobuf = "~2.0"
2120
tokio-core = "0.1"
2221
tokio-timer = "0.2"
2322
fxhash = "0.2"
2423
lazy_static = "0.2.1"
2524
log = "0.3.9"
25+
failure = "0.1"
2626

2727
[dependencies.kvproto]
2828
git = "https://github.com/pingcap/kvproto.git"

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# TiKV Client (Rust)
2+
3+
[![Build Status](https://travis-ci.org/tikv/client-rust.svg?branch=master)](https://travis-ci.org/pingcap/client-rust)
4+
[![Documentation](https://docs.rs/tikv-client/badge.svg)](https://docs.rs/tikv-client/)
5+
6+
> Currently this crate is experimental and some portions (e.g. the Transactional API) are still in active development. You're encouraged to use this library for testing and to help us find problems!
7+
8+
This crate provides a clean, ready to use client for [TiKV](https://github.com/tikv/tikv), a
9+
distributed transactional Key-Value database written in Rust.
10+
11+
With this crate you can easily connect to any TiKV deployment, interact with it, and mutate the data it contains.
12+
13+
This is an open source (Apache 2) project hosted by the Cloud Native Computing Foundation (CNCF) and maintained by the TiKV Authors. *We'd love it if you joined us in improving this project.*
14+
15+
## Install
16+
17+
There are no special requirements to use this. It is a Rust 2018 edition crate supporting stable and nightly.
18+
19+
To use this crate in your project, add it as a dependency in the `Cargo.toml` of your Rust project:
20+
21+
```toml
22+
[dependencies]
23+
# ...Your other dependencies...
24+
tikv-client = "~0.1"
25+
```
26+
27+
## Access the documentation
28+
29+
We recommend using the cargo-generated documentation to browse and understand the API. We've done
30+
our best to include ample, tested, and understandable examples.
31+
32+
You can visit [docs.rs/tikv-client](https://docs.rs/tikv-client/), or build the documentation yourself.
33+
34+
You can access the documentation on your machine by running the following in any project that depends on `tikv-client`.
35+
36+
```bash
37+
cargo doc --package tikv-client --open
38+
# If it didn't work, browse file URL it tried to open with your browser.
39+
```

examples/raw.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ fn main() -> Result<()> {
7070
.expect("Could not delete value");
7171
println!("Key: {:?} deleted", key);
7272

73-
client
74-
.get(key)
75-
.wait()
76-
.expect_err("Get returned value for not existing key");
73+
// Get returns None for non-existing key
74+
assert!(client.get(key).wait()?.is_none());
7775

7876
let pairs: Vec<KvPair> = (1..3)
7977
.map(|i| KvPair::from((Key::from(format!("k{}", i)), Value::from(format!("v{}", i)))))

0 commit comments

Comments
 (0)