-
Notifications
You must be signed in to change notification settings - Fork 361
Upgrade to hyper/http 1.0 #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What are the benefits of migrating to the new version? I tried to do it too, and I found the lack of documentation about all the deprecated things troubling. So I'm reticent to spend quite a lot time without knowing that's worth the work. If anyone wants to do the heavy lifting, we appreciate the contributions. |
Saying this for any readers— |
I gave the PR a start - updating to the correct versions. Unfortunately I hit a snag due to poor documentation. Hopefully if someone understands the hyper Client or HttpConnector's behavior prior to 1.0 and feels comfortable adding to the PR, please go ahead! :) |
I've made some progress on this. I'll probably have a PR ready this week. |
Awesome! Hope you're able to re-use some of the revisions I authored or add onto my PR! Sorry it's been taking me a while, limited bandwidth. |
This PR should fix it, but I'll really appreciate you testing your functions with it before I merge it: You can install the dependency from GitHub directly using this in your Cargo.toml file:
|
It's a small data point, but I upgraded wewerewondering.com to this (https://github.com/jonhoo/wewerewondering/tree/hyper-1), and that seems to be working fine! |
Thanks for the update @jonhoo ! Hopefully we can get a release next week. |
|
Now that version 1.0 of the hyper and http* crates are out, the lambda* crates should probably follow suit. Unfortunately, it's a decently heavy lift, especially due to
Body
changing from a concrete type to a trait (hyperium/hyper#2345). I took a stab at it, but quickly got lost in a sea of<B: Body>
s, and figured I'd leave it to those who know the library best.A few bits I did pick up that may come in handy for someone wanting to take this on:
body::to_bytes(body).await?
becomesbody.collect().await?.to_bytes()
viahttp_body_util::BodyExt
Body
becomesBoxBody<hyper::body::Bytes, hyper::Error>
viahttp_body_util::combinators::BoxBody
if you want to keep it fully type-erased like it is today. Otherwise,hyper::body::Incoming
is the right replacement type for at least mostResponse
s.Connector
trait (or rather, they're relegated tohyper_util::client::legacy
). Instead, there is nowhyper::client::conn::http1::Connection
.Also worth linking this, which it took me a bit to find: https://hyper.rs/guides/1/upgrading/
The text was updated successfully, but these errors were encountered: