Warp: hello.rs - the trait bound `(): core::future::future::Future` is not satisfied

Created on 13 Nov 2019  路  2Comments  路  Source: seanmonstar/warp

I am trying to run the hello.rs (https://github.com/seanmonstar/warp/blob/master/examples/hello.rs) example but keep getting this error:

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
   --> src/main.rs:10:5
    |
10  |     warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`

In Cargo.toml I have this:

[dependencies]
warp = "0.1"
tokio = "0.2.0-alpha.6"

What could I be missing?

Thanks in advance.

Most helpful comment

Hi nbari, to use warp with async await you need to depend on the git repo :

[dependencies]
 warp =  { git = "https://github.com/seanmonstar/warp.git" } 

All 2 comments

Hi nbari, to use warp with async await you need to depend on the git repo :

[dependencies]
 warp =  { git = "https://github.com/seanmonstar/warp.git" } 

Master (and its examples) are using the new std::future type, v0.1 does not. You can look at the 0.1.x branch for its examples, or depend on warp via git.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kitsuneninetails picture kitsuneninetails  路  4Comments

nerdrew picture nerdrew  路  4Comments

alexreg picture alexreg  路  7Comments

weiznich picture weiznich  路  7Comments

hamptokr picture hamptokr  路  4Comments