split Client into (Client, Connection) (#107)
The Connection type is a `Future` that drives all of the IO of the client connection. The Client type is separate, and is used to send requests into the connection.
This commit is contained in:
@@ -480,7 +480,7 @@ where
|
||||
Async::Ready((frame, handle)) => (frame, handle),
|
||||
Async::NotReady => return Ok(Async::NotReady),
|
||||
};
|
||||
assert_eq!(frame.unwrap(), self.frame);
|
||||
assert_eq!(frame.unwrap(), self.frame, "recv_frame");
|
||||
Ok(Async::Ready(handle))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
//! Utilities to support tests.
|
||||
|
||||
#[cfg(not(feature = "unstable"))]
|
||||
compile_error!(
|
||||
"Tests depend on the 'unstable' feature on h2. \
|
||||
Retry with `cargo test --features unstable`"
|
||||
);
|
||||
|
||||
pub extern crate bytes;
|
||||
pub extern crate env_logger;
|
||||
pub extern crate futures;
|
||||
|
||||
@@ -60,7 +60,7 @@ pub trait ClientExt {
|
||||
fn run<F: Future>(&mut self, f: F) -> Result<F::Item, F::Error>;
|
||||
}
|
||||
|
||||
impl<T, B> ClientExt for Client<T, B>
|
||||
impl<T, B> ClientExt for client::Connection<T, B>
|
||||
where
|
||||
T: AsyncRead + AsyncWrite + 'static,
|
||||
B: IntoBuf + 'static,
|
||||
|
||||
Reference in New Issue
Block a user