feat(client): change connectors to return an impl Connection

Instead of returning a tuple `(impl AsyncRead + AsyncWrite, Connected)`,
this adds a new trait, `hyper::client::connect::Connection`, which
allows querying the connection type for a `Connected`.

BREAKING CHANGE: Connectors no longer return a tuple of
  `(T, Connected)`, but a single `T: Connection`.
This commit is contained in:
Sean McArthur
2019-12-04 15:17:49 -08:00
parent 319e8aee15
commit 4d7a2266b8
6 changed files with 68 additions and 37 deletions

View File

@@ -1779,7 +1779,7 @@ impl tower_service::Service<Request<Body>> for TestService {
let replies = self.reply.clone();
Box::pin(async move {
while let Some(chunk) = req.body_mut().next().await {
while let Some(chunk) = hyper::body::HttpBody::next(req.body_mut()).await {
match chunk {
Ok(chunk) => {
tx.send(Msg::Chunk(chunk.to_vec())).unwrap();