Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSplit hyper into more crates #894
Comments
This comment has been minimized.
This comment has been minimized.
|
With the introduction of cargo 'workspaces', this may be more feasible. My gut feeling is to make a |
This comment has been minimized.
This comment has been minimized.
NeoLegends
commented
Sep 5, 2016
•
|
Please split it up into more crates. People could start depending on only the things they truly need instead of importing hyper as one super big crate. |
This comment has been minimized.
This comment has been minimized.
|
For example, in |
This comment has been minimized.
This comment has been minimized.
|
I'm interested in having the |
This comment has been minimized.
This comment has been minimized.
|
Something I've been thinking about recently was to instead make "client" and "server" features in the |
This comment has been minimized.
This comment has been minimized.
|
I do like that as a possible solution.
|
This comment has been minimized.
This comment has been minimized.
|
It would be nice to have a more complete header parsing crate out there, though. |
This comment has been minimized.
This comment has been minimized.
|
@abonander I'm not sure what that means. Something more than httparse? Essentially |
This comment has been minimized.
This comment has been minimized.
|
Yeah, I've gotten |
This comment has been minimized.
This comment has been minimized.
|
If hyper were to define "client" and "server" features, then disabling them would leave the following modules:
While not all strictly needed by the header module, some of it is (error, method, I can't recall if others). That would mean that there wouldn't be much more gained removing the others, for more effort, no? |
This comment has been minimized.
This comment has been minimized.
|
@seanmonstar not |
This comment has been minimized.
This comment has been minimized.
|
Oh right, I forgot about mime since it isn't in the file tree. It'd still be there, since header requires it. |
This comment has been minimized.
This comment has been minimized.
|
So, I'm not sure if it's something necessarily relevant to this issue, but
it would be nice to be able to provide my own hyper client provider to a
library that needs a client without having to modify the library. Neither
splitting hyper nor using features would inherently solve this, I think.
But, this is at least part of my motivation.
|
This comment has been minimized.
This comment has been minimized.
jimmycuadra
commented
Jan 25, 2017
|
I just posted this on #189, but this issue seems more active: Would there be any disadvantages to extracting the status and header modules into their own crates? What about giving them generic (non-"hyper") names? It'd be great to have generic types for these concepts in the Rust ecosystem (like we have the url crate) that could be used by downstream crates without having to tie their APIs to anything specific to Hyper. |
This comment has been minimized.
This comment has been minimized.
jimmycuadra
commented
Feb 26, 2017
•
|
Maintainers, would you please let us know what your inclination is on this? Is it something you're leaning towards doing? Or is more discussion required before you can answer that? If the plan is for this to happen, would it be possible to do as part of the 0.11 release, or would it be done after that, with 0.11 just focusing on async? I ask because we're kind of in limbo on some decisions in one of Ruma's libraries. We're looking for a generic implementation of HTTP methods, HTTP status codes, and HTTP headers. Hyper's types for these things fit the bill perfectly, but we don't want to tie our API to Hyper as-is, with all the other things it comes with. If we know for sure that there aren't plans to split these things out from Hyper, or that they're not even really on the roadmap right now, we can plan accordingly. Thank you! |
This comment has been minimized.
This comment has been minimized.
KodrAus
commented
Feb 26, 2017
|
Specifically, I'd like a crate for status codes. Right now in some response APIs of mine I expose the status as a
|
This comment has been minimized.
This comment has been minimized.
|
I'd still like to advocate for separate crates, if only because it allows them to be built in parallel even in release mode. |
This comment has been minimized.
This comment has been minimized.
|
So, while I don't have a specific announcement to make, I can say that a few of us in the HTTP space are working on a crate that would standardize many of these types, allowing frameworks to depend on those, without having to declare a relationship with a specific server or client implementation (such as hyper). |
This comment has been minimized.
This comment has been minimized.
|
@seanmonstar is it a private project at the moment, or is there somewhere where one can join in, even if just to watch progress? |
habnabit commentedAug 20, 2016
Perhaps a duplicate of #189? Unsure of what all falls under its scope, but I'd like to be able to use more than just
hyper::headerseparate fromhyper. Here's what I pared it down to when I was trying to figure out what all I needed fromhyper:errorheadermethodmimestatusuriversionI ended up with a lot of 'unused function' warnings from
hyper::httpwith the minimal set of changes. Should those be exposed in a split crate, maybe?