I'm trying compile https://github.com/actix/examples/blob/master/http-proxy/src/server.rs but i got below error.
error[E0599]: no method named `from_err` found for type `actix_web::dev::MessageBody<actix_web::HttpRequest>` in the current scope
--> src/main.rs:16:10
|
16 | .from_err()
| ^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
9 | use futures::future::Future;
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: Could not compile `Account`.
It's about this section :
fn api(req: actix_web::HttpRequest) -> Result<actix_web::HttpResponse, actix_web::Error> {
req.body()
.from_err()
.map(|bytes| actix_web::HttpResponse::Ok().body(bytes))
.responder()
}
Just to be sure you compiled example as it is without any modifications?
It is just strange since compiler for some reason says you need to use futures::Future
@uncotion do you use futures 0.1?
It was about futures 0.2.
thanks.
Most helpful comment
@uncotion do you use futures 0.1?