You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
105
105
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
107
117
```toml
108
-
influxdb = { version = "0.4.0", features = ["derive"] }
118
+
influxdb = { version = "0.4.0", default-features = false, features = ["derive", "use-serde", "curl-client"] }
109
119
```
110
120
-**[curl](https://github.com/alexcrichton/curl-rust)**, using [libcurl](https://curl.se/libcurl/)
Copy file name to clipboardExpand all lines: influxdb/src/lib.rs
+21-5Lines changed: 21 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,8 @@
30
30
//! use influxdb::InfluxDbWriteable;
31
31
//! use chrono::{DateTime, Utc};
32
32
//!
33
-
//! #[async_std::main]
34
-
//! // or #[tokio::main] if you prefer
33
+
//! #[tokio::main]
34
+
//! // or #[async_std::main] if you prefer
35
35
//! async fn main() {
36
36
//! // Connect to db `test` on `http://localhost:8086`
37
37
//! let client = Client::new("http://localhost:8086", "test");
@@ -69,11 +69,21 @@
69
69
//!
70
70
//! # Choice of HTTP backend
71
71
//!
72
-
//! To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature:
72
+
//! 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.
73
73
//!
74
-
//! - **[hyper](https://github.com/hyperium/hyper)** (used by default)
74
+
//! - **[hyper](https://github.com/hyperium/hyper)** (through reqwest, used by default), with [rustls](https://github.com/ctz/rustls)
75
+
//! ```toml
76
+
//! influxdb = { version = "0.4.0", features = ["derive"] }
77
+
//! ```
78
+
//!
79
+
//! - **[hyper](https://github.com/hyperium/hyper)** (through reqwest), with native TLS (OpenSSL)
80
+
//! ```toml
81
+
//! influxdb = { version = "0.4.0", default-features = false, features = ["derive", "use-serde", "reqwest-client"] }
82
+
//! ```
83
+
//!
84
+
//! - **[hyper](https://github.com/hyperium/hyper)** (through surf), use this if you need tokio 0.2 compatibility
75
85
//! ```toml
76
-
//! influxdb = { version = "0.4.0", features = ["derive"] }
86
+
//! influxdb = { version = "0.4.0", default-features = false, features = ["derive", "use-serde", "curl-client"] }
77
87
//! ```
78
88
//! - **[curl](https://github.com/alexcrichton/curl-rust)**, using [libcurl](https://curl.se/libcurl/)
79
89
//! ```toml
@@ -99,6 +109,12 @@
99
109
#![allow(clippy::needless_doctest_main)]
100
110
#![allow(clippy::needless_lifetimes)]// False positive in client/mod.rs query fn
0 commit comments