Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cargo run
- Compiling shio-hyper v0.1.0 (file:///Users/jehan/work/src/github.com/althea-mesh/shio-hyper)
- error[E0277]: the trait bound `hyper::Error: std::convert::From<serde_json::Error>` is not satisfied
- --> src/main.rs:53:37
- |
- 53 | let body: RequestBody = serde_json::from_slice(&data)?;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<serde_json::Error>` is not implementedfor `hyper::Error`
- |
- = help: the following implementations were found:
- <hyper::Error as std::convert::From<std::str::Utf8Error>>
- <hyper::Error as std::convert::From<std::string::FromUtf8Error>>
- <hyper::Error as std::convert::From<std::io::Error>>
- <hyper::Error as std::convert::From<hyper::error::UriError>>
- <hyper::Error as std::convert::From<httparse::Error>>
- = note: required by `std::convert::From::from`
- error[E0277]: the trait bound `hyper::Error: std::convert::From<serde_json::Error>` is not satisfied
- --> src/main.rs:60:32
- |
- 60 | let json: IpJson = serde_json::from_slice(&body)?;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<serde_json::Error>` is not implemented for `hyper::Error`
- |
- = help: the following implementations were found:
- <hyper::Error as std::convert::From<std::str::Utf8Error>>
- <hyper::Error as std::convert::From<std::string::FromUtf8Error>>
- <hyper::Error as std::convert::From<std::io::Error>>
- <hyper::Error as std::convert::From<hyper::error::UriError>>
- <hyper::Error as std::convert::From<httparse::Error>>
- = note: required by `std::convert::From::from`
- error[E0308]: mismatched types
- --> src/main.rs:49:5
- |
- 45 | fn proxy(ctx: Context) -> BoxFuture<Response, Error> {
- | -------------------------- expected `std::boxed::Box<futures::Future<Error=errors::Error, Item=shio::Response> + 'static>` because of return type
- ...
- 49 | / ctx.body()
- 50 | | .concat2()
- 51 | | .from_err()
- 52 | | .and_then(|data| {
- ... |
- 62 | | })
- 63 | | .into_box()
- | |___________________^ expected struct `errors::Error`, found enum `hyper::Error`
- |
- = note: expected type `std::boxed::Box<futures::Future<Error=errors::Error, Item=shio::Response> + 'static>`
- found type `std::boxed::Box<futures::Future<Error=hyper::Error, Item=shio::Response> + 'static>`
- error: aborting due to 3 previous errors
- error: Could not compile `shio-hyper`.
- To learn more, run the command again with --verbose.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement