@@ -37,7 +37,7 @@ pub struct Client<C, B> {
3737 #[ cfg( feature = "http1" ) ]
3838 h1_builder : hyper:: client:: conn:: http1:: Builder ,
3939 #[ cfg( feature = "http2" ) ]
40- h2_builder : hyper:: client:: conn:: http2:: Builder ,
40+ h2_builder : hyper:: client:: conn:: http2:: Builder < Exec > ,
4141 pool : pool:: Pool < PoolClient < B > , PoolKey > ,
4242}
4343
@@ -128,7 +128,7 @@ impl Client<(), ()> {
128128impl < C , B > Client < C , B >
129129where
130130 C : Connect + Clone + Send + Sync + ' static ,
131- B : Body + Send + ' static ,
131+ B : Body + Send + ' static + Unpin ,
132132 B :: Data : Send ,
133133 B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
134134{
@@ -458,7 +458,8 @@ where
458458 fn connect_to (
459459 & self ,
460460 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+ {
462463 let executor = self . exec . clone ( ) ;
463464 let pool = self . pool . clone ( ) ;
464465 #[ cfg( feature = "http1" ) ]
@@ -574,7 +575,7 @@ where
574575impl < C , B > tower_service:: Service < Request < B > > for Client < C , B >
575576where
576577 C : Connect + Clone + Send + Sync + ' static ,
577- B : Body + Send + ' static ,
578+ B : Body + Send + ' static + Unpin ,
578579 B :: Data : Send ,
579580 B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
580581{
@@ -594,7 +595,7 @@ where
594595impl < C , B > tower_service:: Service < Request < B > > for & ' _ Client < C , B >
595596where
596597 C : Connect + Clone + Send + Sync + ' static ,
597- B : Body + Send + ' static ,
598+ B : Body + Send + ' static + Unpin ,
598599 B :: Data : Send ,
599600 B :: Error : Into < Box < dyn StdError + Send + Sync > > ,
600601{
@@ -955,7 +956,7 @@ pub struct Builder {
955956 #[ cfg( feature = "http1" ) ]
956957 h1_builder : hyper:: client:: conn:: http1:: Builder ,
957958 #[ cfg( feature = "http2" ) ]
958- h2_builder : hyper:: client:: conn:: http2:: Builder ,
959+ h2_builder : hyper:: client:: conn:: http2:: Builder < Exec > ,
959960 pool_config : pool:: Config ,
960961}
961962
@@ -965,18 +966,18 @@ impl Builder {
965966 where
966967 E : hyper:: rt:: Executor < BoxSendFuture > + Send + Sync + Clone + ' static ,
967968 {
968- let exec = Exec :: new ( executor. clone ( ) ) ;
969+ let exec = Exec :: new ( executor) ;
969970 Self {
970971 client_config : Config {
971972 retry_canceled_requests : true ,
972973 set_host : true ,
973974 ver : Ver :: Auto ,
974975 } ,
975- exec,
976+ exec : exec . clone ( ) ,
976977 #[ cfg( feature = "http1" ) ]
977978 h1_builder : hyper:: client:: conn:: http1:: Builder :: new ( ) ,
978979 #[ cfg( feature = "http2" ) ]
979- h2_builder : hyper:: client:: conn:: http2:: Builder :: new ( executor ) ,
980+ h2_builder : hyper:: client:: conn:: http2:: Builder :: new ( exec ) ,
980981 pool_config : pool:: Config {
981982 idle_timeout : Some ( Duration :: from_secs ( 90 ) ) ,
982983 max_idle_per_host : std:: usize:: MAX ,
0 commit comments