Skip to content

Commit 99b76f7

Browse files
kxtseanmonstar
authored andcommitted
feat(client): add 1.0 compatible client conn API (#3053)
This patch backports client/conn/http1 and http2 modules from 1.0 to ease transition. It allows code still using 0.14.x to switch to the per-version Connection types available in 1.0.
1 parent c849339 commit 99b76f7

File tree

7 files changed

+1154
-3
lines changed

7 files changed

+1154
-3
lines changed

Diff for: .github/workflows/CI.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ jobs:
6262

6363
include:
6464
- rust: stable
65-
features: "--features full"
65+
features: "--features full,backports"
6666
- rust: beta
67-
features: "--features full"
67+
features: "--features full,backports"
6868
- rust: nightly
69-
features: "--features full,nightly"
69+
features: "--features full,nightly,backports"
7070
benches: true
7171

7272
runs-on: ${{ matrix.os }}

Diff for: Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ tcp = [
109109
# C-API support (currently unstable (no semver))
110110
ffi = ["libc"]
111111

112+
# 1.0 compatibile client API
113+
backports = []
114+
112115
# internal features used in CI
113116
nightly = []
114117
__internal_happy_eyeballs_tests = []

Diff for: src/client/conn.rs

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
//! # }
5555
//! ```
5656
57+
#[cfg(all(feature = "backports", feature = "http1"))]
58+
pub mod http1;
59+
#[cfg(all(feature = "backports", feature = "http2"))]
60+
pub mod http2;
61+
5762
use std::error::Error as StdError;
5863
use std::fmt;
5964
#[cfg(not(all(feature = "http1", feature = "http2")))]

0 commit comments

Comments
 (0)