feat(client): Make client an optional feature

cc #2223

BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To
  enable the client, add `features = ["client"]` to the dependency in
  your `Cargo.toml`.
This commit is contained in:
Sean McArthur
2020-11-17 17:06:25 -08:00
committed by GitHub
parent eb092a7b8c
commit 4e55583d30
19 changed files with 242 additions and 168 deletions

View File

@@ -25,7 +25,7 @@ use tower_service::Service;
use super::dispatch;
use crate::body::HttpBody;
use crate::common::{task, BoxSendFuture, Exec, Future, Pin, Poll};
use crate::common::{task, exec::{BoxSendFuture, Exec}, Future, Pin, Poll};
use crate::proto;
use crate::rt::Executor;
#[cfg(feature = "http1")]

View File

@@ -62,7 +62,7 @@ use http::{Method, Request, Response, Uri, Version};
use self::connect::{sealed::Connect, Alpn, Connected, Connection};
use self::pool::{Key as PoolKey, Pool, Poolable, Pooled, Reservation};
use crate::body::{Body, HttpBody};
use crate::common::{lazy as hyper_lazy, task, BoxSendFuture, Future, Lazy, Pin, Poll};
use crate::common::{lazy as hyper_lazy, task, exec::BoxSendFuture, Future, Lazy, Pin, Poll};
use crate::rt::Executor;
#[cfg(feature = "tcp")]

View File

@@ -11,7 +11,7 @@ use futures_channel::oneshot;
use tokio::time::{Duration, Instant, Interval};
use super::Ver;
use crate::common::{task, Exec, Future, Pin, Poll, Unpin};
use crate::common::{task, exec::Exec, Future, Pin, Poll, Unpin};
// FIXME: allow() required due to `impl Trait` leaking types to this lint
#[allow(missing_debug_implementations)]
@@ -777,7 +777,7 @@ mod tests {
use std::time::Duration;
use super::{Connecting, Key, Pool, Poolable, Reservation, WeakOpt};
use crate::common::{task, Exec, Future, Pin};
use crate::common::{task, exec::Exec, Future, Pin};
/// Test unique reservations.
#[derive(Debug, PartialEq, Eq)]