Skip to content

Commit

Permalink
feat(client): add 1.0 compatible client conn API (#3155)
Browse files Browse the repository at this point in the history
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.

Closes #3053 

Co-authored-by: KOVACS Tamas <ktamas@fastmail.fm>
  • Loading branch information
seanmonstar and kxt committed Mar 6, 2023
1 parent c849339 commit 253cc74
Show file tree
Hide file tree
Showing 7 changed files with 1,110 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ jobs:

include:
- rust: stable
features: "--features full"
features: "--features full,backports"
- rust: beta
features: "--features full"
features: "--features full,backports"
- rust: nightly
features: "--features full,nightly"
features: "--features full,nightly,backports"
benches: true

runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ tcp = [
# C-API support (currently unstable (no semver))
ffi = ["libc"]

# enable 1.0 backports
backports = []

# internal features used in CI
nightly = []
__internal_happy_eyeballs_tests = []
Expand Down
5 changes: 5 additions & 0 deletions src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
//! # }
//! ```

#[cfg(all(feature = "backports", feature = "http1"))]
pub mod http1;
#[cfg(all(feature = "backports", feature = "http2"))]
pub mod http2;

use std::error::Error as StdError;
use std::fmt;
#[cfg(not(all(feature = "http1", feature = "http2")))]
Expand Down
Loading

0 comments on commit 253cc74

Please sign in to comment.