Skip to content

Commit c9ad6c7

Browse files
committed
update readme
1 parent c2e1340 commit c9ad6c7

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2020/03/12/Rust-1.45.html">
29-
<img src="https://img.shields.io/badge/rustc-1.45+-yellow.svg" alt='Minimum Rust Version' />
28+
<a href="https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html">
29+
<img src="https://img.shields.io/badge/rustc-1.46+-yellow.svg" alt='Minimum Rust Version' />
3030
</a>
3131
</p>
3232

@@ -62,8 +62,8 @@ use influxdb::{Client, Query, Timestamp};
6262
use influxdb::InfluxDbWriteable;
6363
use chrono::{DateTime, Utc};
6464

65-
#[async_std::main]
66-
// or #[tokio::main] if you prefer
65+
#[tokio::main]
66+
// or #[async_std::main] if you prefer
6767
async fn main() {
6868
// Connect to db `test` on `http://localhost:8086`
6969
let client = Client::new("http://localhost:8086", "test");
@@ -101,11 +101,21 @@ in the repository.
101101

102102
## Choice of HTTP backend
103103

104-
To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature:
104+
To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature. We recommend sticking with the default reqwest-based client, unless you really need async-std compatibility.
105105

106-
- **[hyper](https://github.com/hyperium/hyper)** (used by default)
106+
- **[hyper](https://github.com/hyperium/hyper)** (through reqwest, used by default), with [rustls](https://github.com/ctz/rustls)
107+
```toml
108+
influxdb = { version = "0.4.0", features = ["derive"] }
109+
```
110+
111+
- **[hyper](https://github.com/hyperium/hyper)** (through reqwest), with native TLS (OpenSSL)
112+
```toml
113+
influxdb = { version = "0.4.0", default-features = false, features = ["derive", "use-serde", "reqwest-client"] }
114+
```
115+
116+
- **[hyper](https://github.com/hyperium/hyper)** (through surf), use this if you need tokio 0.2 compatibility
107117
```toml
108-
influxdb = { version = "0.4.0", features = ["derive"] }
118+
influxdb = { version = "0.4.0", default-features = false, features = ["derive", "use-serde", "curl-client"] }
109119
```
110120
- **[curl](https://github.com/alexcrichton/curl-rust)**, using [libcurl](https://curl.se/libcurl/)
111121
```toml

0 commit comments

Comments
 (0)