1
1
use crate :: client:: resp:: ClientResponse ;
2
- use crate :: client:: resp_future:: ClientResponseFuture3 ;
3
2
use crate :: client:: resp_future:: ClientResponseFutureImpl ;
4
3
use crate :: common:: sink_after_headers:: SinkAfterHeadersBox ;
5
4
use crate :: solicit_async:: TryFutureBox ;
@@ -10,6 +9,7 @@ use crate::HttpScheme;
10
9
use crate :: PseudoHeaderName ;
11
10
use crate :: SimpleHttpMessage ;
12
11
use crate :: StreamAfterHeaders ;
12
+ use crate :: StreamAfterHeadersBox ;
13
13
use bytes:: Bytes ;
14
14
use futures:: channel:: oneshot;
15
15
use futures:: future;
@@ -88,15 +88,19 @@ pub trait ClientIntf {
88
88
headers : Headers ,
89
89
body : Option < Bytes > ,
90
90
trailers : Option < Headers > ,
91
- ) -> ClientResponseFuture3 {
92
- ClientResponseFuture3 :: new (
91
+ ) -> TryFutureBox < ( Headers , StreamAfterHeadersBox ) > {
92
+ Box :: pin (
93
93
self . start_request ( headers, body, trailers, true )
94
94
. and_then ( move |( _sender, response) | response) ,
95
95
)
96
96
}
97
97
98
98
/// Start HTTP/2 `GET` request.
99
- fn start_get ( & self , path : & str , authority : & str ) -> ClientResponseFuture3 {
99
+ fn start_get (
100
+ & self ,
101
+ path : & str ,
102
+ authority : & str ,
103
+ ) -> TryFutureBox < ( Headers , StreamAfterHeadersBox ) > {
100
104
let headers = Headers :: from_vec ( vec ! [
101
105
Header :: new( PseudoHeaderName :: Method , "GET" ) ,
102
106
Header :: new( PseudoHeaderName :: Path , path. to_owned( ) ) ,
@@ -124,7 +128,12 @@ pub trait ClientIntf {
124
128
}
125
129
126
130
/// Start HTTP/2 `POST` request with given request body.
127
- fn start_post ( & self , path : & str , authority : & str , body : Bytes ) -> ClientResponseFuture3 {
131
+ fn start_post (
132
+ & self ,
133
+ path : & str ,
134
+ authority : & str ,
135
+ body : Bytes ,
136
+ ) -> TryFutureBox < ( Headers , StreamAfterHeadersBox ) > {
128
137
let headers = Headers :: from_vec ( vec ! [
129
138
Header :: new( PseudoHeaderName :: Method , "POST" ) ,
130
139
Header :: new( PseudoHeaderName :: Path , path. to_owned( ) ) ,
0 commit comments