Split response future from client::Stream (#153)

This commit is contained in:
Carl Lerche
2017-10-16 20:17:07 -07:00
committed by GitHub
parent 7c287af0d0
commit faf59f7e24
9 changed files with 121 additions and 125 deletions

View File

@@ -70,7 +70,7 @@ pub fn main() {
let mut trailers = HeaderMap::new();
trailers.insert("zomg", "hello".parse().unwrap());
let mut stream = client.send_request(request, false).unwrap();
let (response, mut stream) = client.send_request(request, false).unwrap();
// send trailers
stream.send_trailers(trailers).unwrap();
@@ -78,7 +78,7 @@ pub fn main() {
// Spawn a task to run the conn...
handle.spawn(h2.map_err(|e| println!("GOT ERR={:?}", e)));
stream
response
.and_then(|response| {
println!("GOT RESPONSE: {:?}", response);