-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
compatibility with http crate #1313
Comments
I was thinking about starting on this work too. My understanding was that the plan was to replace all the existing hyper types with ones from the http crate. Is there a more specific plan or is there any code underway already? Or can anyone from the community just pick this up? |
I believe that is the plan, but doing so would require a breaking change (thus a 0.x bump). |
I think one question might be if there is a way to introduce parts of the http crate w/o breaking the API just yet? Two possible approaches I could think of:
|
Personally, I'd much rather see hyper's (now redundant) types disappear completely in 0.12. My impression is that people using Rust and hyper at this point understand that the HTTP stack is not stable yet, and that making breaking changes where it's clearly needed is expected in order to push us towards 1.0. |
I think we both are in agreement that that's what should happen for 0.12. (Assuming @seanmonstar making that call of course). Depending on what the time table around this is though, I think it might be beneficial to offer some level of compatibility before introducing 0.12. |
We do expect 0.12 to remove hyper's related types, and use The idea mentioned here is neat, though: providing compatibility with |
See #1317 for the breaking change issue, but we can keep discussion in here for how to provide compatibility in 0.11! |
@seanmonstar Thanks for your input! If you don't mind I'd like your feedback on the following: So far I can see two different approaches, each with their pros and cons on how we can achieve this. It might also make sense to mix the two approaches, depending on how well they work for the different types. EDIT: Although I initially favoured Option 2, after playing around with the code base it seems to be a lot harder to implement than I originally thought due to various reasons (the biggest one being a feature mismatch between the types in hyper and http). So my suggestion would be to go with Option 1 in the beginning, and then optionally work on porting the missing features over to Option 1: Conversion functionsWhere it makes sense, provide Pros
Cons
Option 2:
|
This seems like a good idea regardless, since none of the types can be replaced completely.
This would be a requirement to release it on the 0.11 branch, so if there's something that requires breakage, it will have to wait.
If this can be made to work, this sounds like the best. As you pointed out, it gets more testing of the |
@seanmonstar okay, so after an evening of experimentation, this is where I'm at: I've explored the "http types at the core, hyper types as facade" approach. However, there is a major issue: The So we have either the choice of raising the minimum supported version of Rust to something higher that supports associated constants (would this be considered a breaking change?), or we accept that this approach is not feasible. The conversion-methods only approach on the other hand is feasible in any case since we can hide the methods behind a feature flag, therefore making depending on I have a working implementation of Please let me know how you'd like to proceed. |
Yes, I personally find that a breaking change, when I can control it. (grumble grumble about dependencies not feeling the same, and suddenly hyper's minimum version is forced to change...) So, it probably couldn't have a dependency on the With a feature flag turned on, that seems fair. So then there's the issue of which side should have the performance cost: default, or when using the new shiny
|
Closing this since #1319 got merged. |
Now that the
http
crate is officially published, are there plans to provide a compatibility layer for hyper, or will this have to wait for hyper 0.12?If you're open to the former, I have some glue code I'd be willing to contribute.
The text was updated successfully, but these errors were encountered: