Skip to content
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

Open
dbrgn opened this issue Mar 30, 2016 · 6 comments
Open

Re-export hyper Request #16

dbrgn opened this issue Mar 30, 2016 · 6 comments

Comments

@dbrgn
Copy link

dbrgn commented Mar 30, 2016

The field Request.request is a hyper::server::request::Request. Please consider re-exporting (pub use) that type (e.g. as HyperRequest) in your API, so that users don't have to add an explicit dependency on a specific version of Hyper.

@fengsp
Copy link
Owner

fengsp commented May 12, 2016

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 :)

@fengsp fengsp closed this as completed May 12, 2016
@dbrgn
Copy link
Author

dbrgn commented May 12, 2016

Iron is also re-exporting Hyper types.

@fengsp fengsp reopened this May 12, 2016
@dbrgn
Copy link
Author

dbrgn commented May 12, 2016

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.

@mitsuhiko
Copy link

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.

@fengsp
Copy link
Owner

fengsp commented Jul 18, 2016

Hide hyper as much as possible, we should try to do this better.

@dbrgn
Copy link
Author

dbrgn commented Jul 18, 2016

I think I agree with @mitsuhiko.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants