[dependencies]
tokio = { version = "0.2.11", features = ["full"] }
serde_json = "1.0.48"
But the code is complaining it cannot find the Futures trait, instead It is trying to find:
error[E0599]: no method named `and_then` found for type `impl std::future::Future` in the current scope
--> src\main.rs:8:10
|
8 | .and_then(|mut file| {
| ^^^^^^^^ method not found in `impl std::future::Future`
The code is an exact clone of the example in the tokio docs:
I simply used the io error type, but if one of the function calls can fail with something that isn't an io error, naturally you will need a different error type.
Be aware that the return on the last line of a function is usually left out, like I did in my example.