-
Notifications
You must be signed in to change notification settings - Fork 43
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
Re-export hyper Request #16
Comments
If we are doing that, we might need to re-export everything else too, not a good idea. For now I think it is ok for one application to depend on a specific version of Hyper if the app needs it. If there are any better solutions, please wake me up :) |
Iron is also re-exporting Hyper types. |
The problem is that the user needs to update the version of Hyper every time he/she updates pencil (even for a minor version). And to be able to do that, one needs to look at the source repository at that version to see the exact dependency requirement. |
I would propose to do the entire opposite: hide hyper as much as possible and only give access to it through well hidden APIs. Hyper will undergo big changes going forward from what I can tell and the typed high level access is actually really inconvenient as a user. I would propose to find the places where one currently needs to get the hyper object and instead to provide convenience APIs to avoid it. For instance there should be a header view for the request to access the header values a strings. Likewise there should be a way to set and view response headers as strings without having to interface with hyper as well. Ideally in the public API hyper is entirely invisible. WRT version mismatches: cargo is planning on coming up with a story for such public API re-exports so this will get easier going forward. |
Hide hyper as much as possible, we should try to do this better. |
I think I agree with @mitsuhiko. |
The field
Request.request
is ahyper::server::request::Request
. Please consider re-exporting (pub use) that type (e.g. asHyperRequest
) in your API, so that users don't have to add an explicit dependency on a specific version of Hyper.The text was updated successfully, but these errors were encountered: