Created
July 16, 2017 18:41
-
-
Save kinggoesgaming/386c15b04ccd05415610fced26873b91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling ore v0.1.0 (file:///home/kgg_dev/src/ore) | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:62:38 | |
| | |
62 | res.body().concat2().and_then(move |body| { | |
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:61:14 | |
| | |
61 | .and_then(|res| { | |
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
= note: required because of the requirements on the impl of `futures::Future` for `futures::AndThen<futures::stream::Concat2<hyper::Body>, (), [closure@src/project/mod.rs:62:47: 64:18 data:_]>` | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:67:14 | |
| | |
67 | core.run(get)?; | |
| ^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:62:38 | |
| | |
62 | res.body().concat2().and_then(move |body| { | |
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:61:14 | |
| | |
61 | .and_then(|res| { | |
| ^^^^^^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
= note: required because of the requirements on the impl of `futures::Future` for `futures::AndThen<futures::stream::Concat2<hyper::Body>, (), [closure@src/project/mod.rs:62:47: 64:18 data:_]>` | |
error[E0277]: the trait bound `(): futures::Future` is not satisfied | |
--> src/project/mod.rs:67:14 | |
| | |
67 | core.run(get)?; | |
| ^^^ the trait `futures::Future` is not implemented for `()` | |
| | |
= note: required because of the requirements on the impl of `futures::IntoFuture` for `()` | |
error: aborting due to 3 previous errors | |
error: Could not compile `ore`. | |
error: aborting due to 3 previous errors | |
error: build failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn request(&self, threads: usize, uri: &str) -> request::Result<&[u8]> { | |
use futures::{Future,Stream}; | |
use hyper; | |
use hyper::client; | |
use hyper_tls; | |
use tokio_core::reactor; | |
let mut core = reactor::Core::new()?; | |
let client = hyper::Client::configure() | |
.connector(hyper_tls::HttpsConnector::new(threads, &core.handle())?) | |
.build(&core.handle()); | |
let uri = format!("{}/projects/{}", uri, self.plugin_id); | |
let data: &[u8]; | |
let get = client.get(uri.parse()?) | |
.and_then(|res| { | |
res.body().concat2().and_then(move |body| { | |
data = &body; | |
}) | |
}); | |
core.run(get)?; | |
Ok(data) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment