Update to Tokio 0.2 (#428)

This commit is contained in:
Sean McArthur
2019-11-27 14:53:57 -08:00
committed by GitHub
parent 37b66e8981
commit 4398e169e8
53 changed files with 473 additions and 972 deletions

View File

@@ -27,7 +27,7 @@ pub use super::{
pub use super::assert::assert_frame_eq;
// Re-export useful crates
pub use super::mock_io;
pub use tokio_test::io as mock_io;
pub use {bytes, env_logger, futures, http, tokio::io as tokio_io};
// Re-export primary future types
@@ -42,7 +42,10 @@ pub use super::client_ext::SendRequestExt;
// Re-export HTTP types
pub use http::{uri, HeaderMap, Method, Request, Response, StatusCode, Version};
pub use bytes::{Buf, BufMut, Bytes, BytesMut, IntoBuf};
pub use bytes::{
buf::{BufExt, BufMutExt},
Buf, BufMut, Bytes, BytesMut,
};
pub use tokio::io::{AsyncRead, AsyncWrite};
@@ -61,7 +64,7 @@ pub trait MockH2 {
fn handshake(&mut self) -> &mut Self;
}
impl MockH2 for super::mock_io::Builder {
impl MockH2 for tokio_test::io::Builder {
fn handshake(&mut self) -> &mut Self {
self.write(b"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n")
// Settings frame
@@ -81,8 +84,7 @@ pub trait ClientExt {
impl<T, B> ClientExt for client::Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + 'static,
B: IntoBuf + Unpin + 'static,
B::Buf: Unpin,
B: Buf + Unpin + 'static,
{
fn run<'a, F: Future + Unpin + 'a>(
&'a mut self,