You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use async_std::prelude::*;use async_std::task::block_on;use reqwest::Client;asyncfnrun() -> Result<(),()>{letmut url = "";let res = Client::new().get(url).send().await?;let result = res.to_string();Ok(())}fnmain(){block_on(run());}
error[E0277]: the trait bound `std::result::Result<reqwest::response::Response, reqwest::error::Error>: std::future::Future` is not satisfied
--> src/main.rs:11:15
|
11 | let res = Client::new().get(url).send().await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `std::result::Result<reqwest::response::Response, reqwest::error::Error>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
what the heck is this error? async function should be return Future of Output = std::result::Result<reqwest::response::Response, reqwest::error::Error>, why don't satisfy?How could I solve this?
The text was updated successfully, but these errors were encountered:
@CGQAQ to my knowledge reqwest only works with tokio out of the box. If you're looking for a runtime-agnostic HTTP client, surf might be an option.
@yoshuawuyts Thank you very much, I already know whats happend, that's why I closed this issue.
reqwest 0.9.x depends on futures = "0.1.23", I am figured out that version of futures crate probably deprecated, don't work with .await anymore
And I also filed a new issue about this pretty frustrating experience issue page
what the heck is this error? async function should be return Future of
Output = std::result::Result<reqwest::response::Response, reqwest::error::Error>
, why don't satisfy?How could I solve this?The text was updated successfully, but these errors were encountered: