feat(lib): replace types with those from http crate

BREAKING CHANGE: `Method`, `Request`, `Response`, `StatusCode`,
  `Version`, and `Uri` have been replaced with types from the `http`
  crate. The `hyper::header` module is gone for now.

  Removed `Client::get`, since it needed to construct a `Request<B>`
  with an empty body. Just use `Client::request` instead.

  Removed `compat` cargo feature, and `compat` related API.
This commit is contained in:
Sean McArthur
2018-02-28 16:37:17 -08:00
parent a37e6b59e6
commit 3cd48b45fb
109 changed files with 1004 additions and 14411 deletions

View File

@@ -14,7 +14,7 @@ use bytes::Bytes;
use futures::{Future, Poll, Stream};
use tokio_io::{AsyncRead, AsyncWrite};
use proto;
use proto::{self, Body};
use super::{HyperService, Request, Response, Service};
/// A future binding a connection with a Service.
@@ -59,7 +59,7 @@ pub struct Parts<T> {
// ===== impl Connection =====
impl<I, B, S> Connection<I, S>
where S: Service<Request = Request, Response = Response<B>, Error = ::Error> + 'static,
where S: Service<Request = Request<Body>, Response = Response<B>, Error = ::Error> + 'static,
I: AsyncRead + AsyncWrite + 'static,
B: Stream<Error=::Error> + 'static,
B::Item: AsRef<[u8]>,
@@ -97,7 +97,7 @@ where S: Service<Request = Request, Response = Response<B>, Error = ::Error> + '
}
impl<I, B, S> Future for Connection<I, S>
where S: Service<Request = Request, Response = Response<B>, Error = ::Error> + 'static,
where S: Service<Request = Request<Body>, Response = Response<B>, Error = ::Error> + 'static,
I: AsyncRead + AsyncWrite + 'static,
B: Stream<Error=::Error> + 'static,
B::Item: AsRef<[u8]>,