Update to hyper 0.12 #38

Closed
opened 2019-07-02 01:43:46 +12:00 by sinitcin · 6 comments
sinitcin commented 2019-07-02 01:43:46 +12:00 (Migrated from github.com)

Hello! I don't understand can i build this code https://github.com/sinitcin/microservice

error[E0599]: no method named `deconstruct` found for type `hyper::Request<()>` in the current scope
  --> src/post_multipart/post_multipart.rs:30:63
   |
30 |         let (_, _, headers, _, _, mut reader) = hyper_request.deconstruct();
   |                                                               ^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `microservice`.

Please help me =(

Hello! I don't understand can i build this code https://github.com/sinitcin/microservice ``` error[E0599]: no method named `deconstruct` found for type `hyper::Request<()>` in the current scope --> src/post_multipart/post_multipart.rs:30:63 | 30 | let (_, _, headers, _, _, mut reader) = hyper_request.deconstruct(); | ^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0599`. error: Could not compile `microservice`. ``` Please help me =(
mikedilger commented 2019-07-02 09:58:34 +12:00 (Migrated from github.com)

formdata was written for hyper version 0.10. You are specifying "*" which will pickup the lastest hyper which I believe is version 0.12. There are many breaking changes between those two versions. I haven't tried using formdata with hyper 0.12... I suspect it's possible but I just haven't looked into the differences closely enough.

formdata was written for hyper version 0.10. You are specifying "*" which will pickup the lastest hyper which I believe is version 0.12. There are many breaking changes between those two versions. I haven't tried using formdata with hyper 0.12... I suspect it's possible but I just haven't looked into the differences closely enough.
mikedilger commented 2019-07-02 10:02:25 +12:00 (Migrated from github.com)

maybe something like this (I haven't tried it):

let headers = hyper_request.headers();

and then instead of using 'reader' just use 'hyper_request' itself.

maybe something like this (I haven't tried it): ````rust let headers = hyper_request.headers(); ```` and then instead of using 'reader' just use 'hyper_request' itself.
sinitcin commented 2019-07-02 18:33:19 +12:00 (Migrated from github.com)

error[E0308]: mismatched types
  --> src/post_multipart/post_multipart.rs:38:69
   |
38 |         let form_data = formdata::read_formdata(&mut hyper_request, headers).unwrap();
   |                                                                     ^^^^^^^ expected struct `hyper::header::Headers`, found struct `hyper::HeaderMap`
   |
   = note: expected type `&hyper::header::Headers`
              found type `&hyper::HeaderMap`

error[E0277]: the trait bound `hyper::Request<()>: std::io::Read` is not satisfied
  --> src/post_multipart/post_multipart.rs:38:25
   |
38 |         let form_data = formdata::read_formdata(&mut hyper_request, headers).unwrap();
   |                         ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::io::Read` is not implemented for `hyper::Request<()>`
   |
   = note: required by `formdata::read_formdata`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `microservice`.

Good try, but no =( Can you upgrade crate for compatibility with latest version of hyper?

```Rust error[E0308]: mismatched types --> src/post_multipart/post_multipart.rs:38:69 | 38 | let form_data = formdata::read_formdata(&mut hyper_request, headers).unwrap(); | ^^^^^^^ expected struct `hyper::header::Headers`, found struct `hyper::HeaderMap` | = note: expected type `&hyper::header::Headers` found type `&hyper::HeaderMap` error[E0277]: the trait bound `hyper::Request<()>: std::io::Read` is not satisfied --> src/post_multipart/post_multipart.rs:38:25 | 38 | let form_data = formdata::read_formdata(&mut hyper_request, headers).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::io::Read` is not implemented for `hyper::Request<()>` | = note: required by `formdata::read_formdata` error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. error: Could not compile `microservice`. ``` Good try, but no =( Can you upgrade crate for compatibility with latest version of hyper?
mikedilger commented 2019-07-05 11:34:28 +12:00 (Migrated from github.com)

You might want to look for a different library as I don't have the time to work on upgrading formdata at the moment. But I'll leave this issue open as it does need to be addressed eventually if formdata is to survive.

You might want to look for a different library as I don't have the time to work on upgrading formdata at the moment. But I'll leave this issue open as it does need to be addressed eventually if formdata is to survive.
sinitcin commented 2019-07-05 18:45:20 +12:00 (Migrated from github.com)

Thank you anyway. If i can fix this earlier that you i send PR for you.

Thank you anyway. If i can fix this earlier that you i send PR for you.
mikedilger commented 2023-09-30 06:55:49 +13:00 (Migrated from github.com)

Closing to to archival status

Closing to to archival status
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mikedilger/formdata#38
No description provided.