@@ -8,7 +8,7 @@ use tokio::io::{AsyncRead, AsyncWrite};
8
8
use tokio:: time:: timeout;
9
9
use tokio_io_timeout:: TimeoutStream ;
10
10
11
- use hyper:: client:: connect:: { Connect , Connected , Connection } ;
11
+ use hyper:: client:: connect:: { Connected , Connection } ;
12
12
use hyper:: { service:: Service , Uri } ;
13
13
14
14
mod stream;
@@ -30,7 +30,13 @@ pub struct TimeoutConnector<T> {
30
30
write_timeout : Option < Duration > ,
31
31
}
32
32
33
- impl < T : Connect > TimeoutConnector < T > {
33
+ impl < T > TimeoutConnector < T >
34
+ where
35
+ T : Service < Uri > + Send ,
36
+ T :: Response : AsyncRead + AsyncWrite + Send + Unpin ,
37
+ T :: Future : Send + ' static ,
38
+ T :: Error : Into < BoxError > ,
39
+ {
34
40
/// Construct a new TimeoutConnector with a given connector implementing the `Connect` trait
35
41
pub fn new ( connector : T ) -> Self {
36
42
TimeoutConnector {
@@ -116,9 +122,12 @@ impl<T> TimeoutConnector<T> {
116
122
}
117
123
}
118
124
119
- impl < T : Connect > Connection for TimeoutConnector < T >
125
+ impl < T > Connection for TimeoutConnector < T >
120
126
where
121
- T : AsyncRead + AsyncWrite + Connection + Unpin ,
127
+ T : AsyncRead + AsyncWrite + Connection + Service < Uri > + Send + Unpin ,
128
+ T :: Response : AsyncRead + AsyncWrite + Send + Unpin ,
129
+ T :: Future : Send + ' static ,
130
+ T :: Error : Into < BoxError > ,
122
131
{
123
132
fn connected ( & self ) -> Connected {
124
133
self . connector . connected ( )
0 commit comments