mirror of https://github.com/tikv/client-rust.git
Upgrade toolchain and dependencies.
CI errors should be fixed and feature gates are removed. Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
parent
2eccbfe7b6
commit
f093c64f21
|
|
@ -22,7 +22,7 @@ derive-new = "0.5"
|
||||||
failure = "0.1"
|
failure = "0.1"
|
||||||
futures-preview = { version = "0.3.0-alpha.18", features = ["compat", "async-await", "nightly"] }
|
futures-preview = { version = "0.3.0-alpha.18", features = ["compat", "async-await", "nightly"] }
|
||||||
grpcio = { version = "0.5.0-alpha", features = [ "secure", "prost-codec" ], default-features = false }
|
grpcio = { version = "0.5.0-alpha", features = [ "secure", "prost-codec" ], default-features = false }
|
||||||
kvproto = { git = "https://github.com/pingcap/kvproto.git", rev = "81e0c4635c2e28462fa0ad82c39f126448976de7", features = [ "prost-codec" ], default-features = false }
|
kvproto = { git = "https://github.com/pingcap/kvproto.git", rev = "2fc6229ed6097b59dbe51525c7a65b19543a94ca", features = [ "prost-codec" ], default-features = false }
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
log = "0.3.9"
|
log = "0.3.9"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
|
|
@ -38,7 +38,7 @@ features = ["push", "process"]
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
clap = "2.32"
|
clap = "2.32"
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
runtime = { version = "0.3.0-alpha.6", default-features = false }
|
runtime = { version = "0.3.0-alpha.7", default-features = false }
|
||||||
runtime-tokio = "0.3.0-alpha.5"
|
runtime-tokio = "0.3.0-alpha.6"
|
||||||
proptest = "0.9"
|
proptest = "0.9"
|
||||||
proptest-derive = "0.1.0"
|
proptest-derive = "0.1.0"
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ This is an open source (Apache 2) project hosted by the Cloud Native Computing F
|
||||||
|
|
||||||
The TiKV client is a Rust library (crate). It uses async/await internally and exposes some `async fn` APIs as well.
|
The TiKV client is a Rust library (crate). It uses async/await internally and exposes some `async fn` APIs as well.
|
||||||
|
|
||||||
Async/await is a new feature in Rust and is currently unstable. To use it you'll need to add the feature flag `#![async_await]` to your crate and use a nightly compiler (see below).
|
Async/await is a new feature in Rust and cannot be used with a stable Rust compiler. To use it now you'll need to use Rust 1.39 (see below).
|
||||||
|
|
||||||
To use this crate in your project, add it as a dependency in your `Cargo.toml`:
|
To use this crate in your project, add it as a dependency in your `Cargo.toml`:
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ To check what version of Rust you are using, run
|
||||||
rustc --version
|
rustc --version
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll see something like `rustc 1.38.0-nightly (dddb7fca0 2019-07-30)` where the `1.38.0` is the toolchain version, and `nightly` is the channel (stable/beta/nightly). To install another toolchain use
|
You'll see something like `rustc 1.39.0-nightly (eeba189cf 2019-08-24)` where the `1.39.0` is the toolchain version, and `nightly` is the channel (stable/beta/nightly). To install another toolchain use
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rustup toolchain install nightly
|
rustup toolchain install nightly
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
|
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
|
||||||
|
|
||||||
#![feature(async_await, await_macro)]
|
|
||||||
#![type_length_limit = "8165158"]
|
#![type_length_limit = "8165158"]
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
|
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
|
||||||
|
|
||||||
#![feature(async_await, await_macro)]
|
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
use crate::common::parse_args;
|
use crate::common::parse_args;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
nightly-2019-07-31
|
nightly-2019-08-25
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
#![type_length_limit = "16777216"]
|
#![type_length_limit = "16777216"]
|
||||||
#![allow(clippy::redundant_closure)]
|
#![allow(clippy::redundant_closure)]
|
||||||
#![allow(clippy::type_complexity)]
|
#![allow(clippy::type_complexity)]
|
||||||
#![feature(async_await)]
|
|
||||||
#![cfg_attr(test, feature(specialization))]
|
#![cfg_attr(test, feature(specialization))]
|
||||||
|
|
||||||
//! This crate provides a clean, ready to use client for [TiKV](https://github.com/tikv/tikv), a
|
//! This crate provides a clean, ready to use client for [TiKV](https://github.com/tikv/tikv), a
|
||||||
|
|
@ -56,7 +55,6 @@
|
||||||
//! ([raw](raw::Client), [transactional](transaction::Client)).
|
//! ([raw](raw::Client), [transactional](transaction::Client)).
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! # #![feature(async_await)]
|
|
||||||
//! # use tikv_client::*;
|
//! # use tikv_client::*;
|
||||||
//! # use futures::prelude::*;
|
//! # use futures::prelude::*;
|
||||||
//!
|
//!
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ impl Client {
|
||||||
/// Create a new [`Client`](Client).
|
/// Create a new [`Client`](Client).
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, RawClient};
|
/// # use tikv_client::{Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -46,7 +45,6 @@ impl Client {
|
||||||
/// supplied column family constraint. The original `Client` can still be used.
|
/// supplied column family constraint. The original `Client` can still be used.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, RawClient};
|
/// # use tikv_client::{Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -70,7 +68,6 @@ impl Client {
|
||||||
/// will be ignored.
|
/// will be ignored.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, RawClient, ToOwnedRange};
|
/// # use tikv_client::{Config, RawClient, ToOwnedRange};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -92,7 +89,6 @@ impl Client {
|
||||||
/// given key.
|
/// given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Value, Config, RawClient};
|
/// # use tikv_client::{Value, Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -112,7 +108,6 @@ impl Client {
|
||||||
/// given keys.
|
/// given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{KvPair, Config, RawClient};
|
/// # use tikv_client::{KvPair, Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -134,7 +129,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in the setting of the value associated with the given key.
|
/// Once resolved this request will result in the setting of the value associated with the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Value, Config, RawClient};
|
/// # use tikv_client::{Key, Value, Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -158,7 +152,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in the setting of the value associated with the given key.
|
/// Once resolved this request will result in the setting of the value associated with the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Error, Result, KvPair, Key, Value, Config, RawClient, ToOwnedRange};
|
/// # use tikv_client::{Error, Result, KvPair, Key, Value, Config, RawClient, ToOwnedRange};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -182,7 +175,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in the deletion of the given key.
|
/// Once resolved this request will result in the deletion of the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Config, RawClient};
|
/// # use tikv_client::{Key, Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -201,7 +193,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in the deletion of the given keys.
|
/// Once resolved this request will result in the deletion of the given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, RawClient};
|
/// # use tikv_client::{Config, RawClient};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -223,7 +214,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in the deletion of all keys over the given range.
|
/// Once resolved this request will result in the deletion of all keys over the given range.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Config, RawClient, ToOwnedRange};
|
/// # use tikv_client::{Key, Config, RawClient, ToOwnedRange};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -242,7 +232,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in a scanner over the given keys.
|
/// Once resolved this request will result in a scanner over the given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{KvPair, Config, RawClient, ToOwnedRange};
|
/// # use tikv_client::{KvPair, Config, RawClient, ToOwnedRange};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -275,7 +264,6 @@ impl Client {
|
||||||
/// Once resolved this request will result in a set of scanners over the given keys.
|
/// Once resolved this request will result in a set of scanners over the given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Config, RawClient, ToOwnedRange};
|
/// # use tikv_client::{Key, Config, RawClient, ToOwnedRange};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ impl Client {
|
||||||
/// Creates a new [`Client`](Client) once the [`Connect`](Connect) resolves.
|
/// Creates a new [`Client`](Client) once the [`Connect`](Connect) resolves.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// use tikv_client::{Config, TransactionClient};
|
/// use tikv_client::{Config, TransactionClient};
|
||||||
/// use futures::prelude::*;
|
/// use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -38,7 +37,6 @@ impl Client {
|
||||||
/// Using the transaction you can issue commands like [`get`](Transaction::get) or [`set`](Transaction::set).
|
/// Using the transaction you can issue commands like [`get`](Transaction::get) or [`set`](Transaction::set).
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// use tikv_client::{Config, TransactionClient};
|
/// use tikv_client::{Config, TransactionClient};
|
||||||
/// use futures::prelude::*;
|
/// use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -63,7 +61,6 @@ impl Client {
|
||||||
/// Retrieves the current [`Timestamp`](Timestamp).
|
/// Retrieves the current [`Timestamp`](Timestamp).
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// use tikv_client::{Config, TransactionClient};
|
/// use tikv_client::{Config, TransactionClient};
|
||||||
/// use futures::prelude::*;
|
/// use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -82,7 +79,6 @@ impl Client {
|
||||||
/// Once resolved it will result in a connected [`Client`](Client).
|
/// Once resolved it will result in a connected [`Client`](Client).
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// use tikv_client::{Config, TransactionClient, Connect};
|
/// use tikv_client::{Config, TransactionClient, Connect};
|
||||||
/// use futures::prelude::*;
|
/// use futures::prelude::*;
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ use std::sync::Arc;
|
||||||
/// Create a new transaction from a timestamp using `new`.
|
/// Create a new transaction from a timestamp using `new`.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// use tikv_client::{Config, TransactionClient};
|
/// use tikv_client::{Config, TransactionClient};
|
||||||
/// use futures::prelude::*;
|
/// use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -47,7 +46,6 @@ impl Transaction {
|
||||||
/// Gets the value associated with the given key.
|
/// Gets the value associated with the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Value, Config, transaction::Client};
|
/// # use tikv_client::{Value, Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -72,7 +70,6 @@ impl Transaction {
|
||||||
/// Gets the values associated with the given keys.
|
/// Gets the values associated with the given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Value, Config, transaction::Client};
|
/// # use tikv_client::{Key, Value, Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # use std::collections::HashMap;
|
/// # use std::collections::HashMap;
|
||||||
|
|
@ -114,7 +111,6 @@ impl Transaction {
|
||||||
/// Sets the value associated with the given key.
|
/// Sets the value associated with the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Value, Config, transaction::Client};
|
/// # use tikv_client::{Key, Value, Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -135,7 +131,6 @@ impl Transaction {
|
||||||
/// Deletes the given key.
|
/// Deletes the given key.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Key, Config, transaction::Client};
|
/// # use tikv_client::{Key, Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -155,7 +150,6 @@ impl Transaction {
|
||||||
/// Locks the given keys.
|
/// Locks the given keys.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, transaction::Client};
|
/// # use tikv_client::{Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
@ -176,7 +170,6 @@ impl Transaction {
|
||||||
/// Commits the actions of the transaction.
|
/// Commits the actions of the transaction.
|
||||||
///
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
/// # #![feature(async_await)]
|
|
||||||
/// # use tikv_client::{Config, transaction::Client};
|
/// # use tikv_client::{Config, transaction::Client};
|
||||||
/// # use futures::prelude::*;
|
/// # use futures::prelude::*;
|
||||||
/// # futures::executor::block_on(async {
|
/// # futures::executor::block_on(async {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#![cfg(feature = "integration-tests")]
|
#![cfg(feature = "integration-tests")]
|
||||||
#![feature(async_await)]
|
|
||||||
|
|
||||||
use failure::Fallible;
|
use failure::Fallible;
|
||||||
use futures::executor::ThreadPool;
|
use futures::executor::ThreadPool;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue