Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. $ cargo run
  2. Compiling shio-hyper v0.1.0 (file:///Users/jehan/work/src/github.com/althea-mesh/shio-hyper)
  3. error[E0277]: the trait bound `hyper::Error: std::convert::From<serde_json::Error>` is not satisfied
  4. --> src/main.rs:53:37
  5. |
  6. 53 | let body: RequestBody = serde_json::from_slice(&data)?;
  7. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<serde_json::Error>` is not implementedfor `hyper::Error`
  8. |
  9. = help: the following implementations were found:
  10. <hyper::Error as std::convert::From<std::str::Utf8Error>>
  11. <hyper::Error as std::convert::From<std::string::FromUtf8Error>>
  12. <hyper::Error as std::convert::From<std::io::Error>>
  13. <hyper::Error as std::convert::From<hyper::error::UriError>>
  14. <hyper::Error as std::convert::From<httparse::Error>>
  15. = note: required by `std::convert::From::from`
  16.  
  17. error[E0277]: the trait bound `hyper::Error: std::convert::From<serde_json::Error>` is not satisfied
  18. --> src/main.rs:60:32
  19. |
  20. 60 | let json: IpJson = serde_json::from_slice(&body)?;
  21. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<serde_json::Error>` is not implemented for `hyper::Error`
  22. |
  23. = help: the following implementations were found:
  24. <hyper::Error as std::convert::From<std::str::Utf8Error>>
  25. <hyper::Error as std::convert::From<std::string::FromUtf8Error>>
  26. <hyper::Error as std::convert::From<std::io::Error>>
  27. <hyper::Error as std::convert::From<hyper::error::UriError>>
  28. <hyper::Error as std::convert::From<httparse::Error>>
  29. = note: required by `std::convert::From::from`
  30.  
  31. error[E0308]: mismatched types
  32. --> src/main.rs:49:5
  33. |
  34. 45 | fn proxy(ctx: Context) -> BoxFuture<Response, Error> {
  35. | -------------------------- expected `std::boxed::Box<futures::Future<Error=errors::Error, Item=shio::Response> + 'static>` because of return type
  36. ...
  37. 49 | / ctx.body()
  38. 50 | | .concat2()
  39. 51 | | .from_err()
  40. 52 | | .and_then(|data| {
  41. ... |
  42. 62 | | })
  43. 63 | | .into_box()
  44. | |___________________^ expected struct `errors::Error`, found enum `hyper::Error`
  45. |
  46. = note: expected type `std::boxed::Box<futures::Future<Error=errors::Error, Item=shio::Response> + 'static>`
  47. found type `std::boxed::Box<futures::Future<Error=hyper::Error, Item=shio::Response> + 'static>`
  48.  
  49. error: aborting due to 3 previous errors
  50.  
  51. error: Could not compile `shio-hyper`.
  52.  
  53. To learn more, run the command again with --verbose.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement