@@ -37,7 +37,7 @@ pub struct Client<C, B> {
37
37
#[ cfg( feature = "http1" ) ]
38
38
h1_builder : hyper:: client:: conn:: http1:: Builder ,
39
39
#[ cfg( feature = "http2" ) ]
40
- h2_builder : hyper:: client:: conn:: http2:: Builder ,
40
+ h2_builder : hyper:: client:: conn:: http2:: Builder < Exec > ,
41
41
pool : pool:: Pool < PoolClient < B > , PoolKey > ,
42
42
}
43
43
@@ -128,7 +128,7 @@ impl Client<(), ()> {
128
128
impl < C , B > Client < C , B >
129
129
where
130
130
C : Connect + Clone + Send + Sync + ' static ,
131
- B : Body + Send + ' static ,
131
+ B : Body + Send + ' static + Unpin ,
132
132
B :: Data : Send ,
133
133
B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
134
134
{
@@ -458,7 +458,8 @@ where
458
458
fn connect_to (
459
459
& self ,
460
460
pool_key : PoolKey ,
461
- ) -> impl Lazy < Output = Result < pool:: Pooled < PoolClient < B > , PoolKey > , Error > > + Unpin {
461
+ ) -> impl Lazy < Output = Result < pool:: Pooled < PoolClient < B > , PoolKey > , Error > > + Send + Unpin
462
+ {
462
463
let executor = self . exec . clone ( ) ;
463
464
let pool = self . pool . clone ( ) ;
464
465
#[ cfg( feature = "http1" ) ]
@@ -574,7 +575,7 @@ where
574
575
impl < C , B > tower_service:: Service < Request < B > > for Client < C , B >
575
576
where
576
577
C : Connect + Clone + Send + Sync + ' static ,
577
- B : Body + Send + ' static ,
578
+ B : Body + Send + ' static + Unpin ,
578
579
B :: Data : Send ,
579
580
B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
580
581
{
@@ -594,7 +595,7 @@ where
594
595
impl < C , B > tower_service:: Service < Request < B > > for & ' _ Client < C , B >
595
596
where
596
597
C : Connect + Clone + Send + Sync + ' static ,
597
- B : Body + Send + ' static ,
598
+ B : Body + Send + ' static + Unpin ,
598
599
B :: Data : Send ,
599
600
B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
600
601
{
@@ -955,7 +956,7 @@ pub struct Builder {
955
956
#[ cfg( feature = "http1" ) ]
956
957
h1_builder : hyper:: client:: conn:: http1:: Builder ,
957
958
#[ cfg( feature = "http2" ) ]
958
- h2_builder : hyper:: client:: conn:: http2:: Builder ,
959
+ h2_builder : hyper:: client:: conn:: http2:: Builder < Exec > ,
959
960
pool_config : pool:: Config ,
960
961
}
961
962
@@ -965,18 +966,18 @@ impl Builder {
965
966
where
966
967
E : hyper:: rt:: Executor < BoxSendFuture > + Send + Sync + Clone + ' static ,
967
968
{
968
- let exec = Exec :: new ( executor. clone ( ) ) ;
969
+ let exec = Exec :: new ( executor) ;
969
970
Self {
970
971
client_config : Config {
971
972
retry_canceled_requests : true ,
972
973
set_host : true ,
973
974
ver : Ver :: Auto ,
974
975
} ,
975
- exec,
976
+ exec : exec . clone ( ) ,
976
977
#[ cfg( feature = "http1" ) ]
977
978
h1_builder : hyper:: client:: conn:: http1:: Builder :: new ( ) ,
978
979
#[ cfg( feature = "http2" ) ]
979
- h2_builder : hyper:: client:: conn:: http2:: Builder :: new ( executor ) ,
980
+ h2_builder : hyper:: client:: conn:: http2:: Builder :: new ( exec ) ,
980
981
pool_config : pool:: Config {
981
982
idle_timeout : Some ( Duration :: from_secs ( 90 ) ) ,
982
983
max_idle_per_host : std:: usize:: MAX ,
0 commit comments