-
-
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
Migrate hyper::header to its own crate #189
Comments
Hm, Yea. I could make 3 sub crates, hyperc, hyperd, and hyperp, or I don't think I want them in separate repos and such, though. On Wed, Dec 10, 2014, 9:09 AM Richard Diamond notifications@github.com
|
That would be excellent!
|
Yea I figured |
I suppose I can live with that. |
It looks to me like Cargo got support for sub-crates: http://doc.crates.io/guide.html#path-dependencies I propose to split Hyper into |
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. |
Case in point: my email/mime creation crate depends on hyper, and it has nothing to do with HTTP. I don't think splitting it up into lots of tiny crates makes sense, but headers/mime should really be separate. |
Yeah, looking at the IANA list of headers, it seems that headers span more than just http. I can also see that we are missing many of them! It would be nice to see if we could split them out and do some more rgourous testing of our implementation coverage, perhaps even testing to see how many we implement based on their supplied CSV file. |
This will be done as part of the 0.12 release. When the rest of the types are replaced with This will mean a change to the API is likely needed, perhaps as just a way to get and set typed values by taking Also needs a name. Some ideas:
|
My vote would be Rationale is: The base |
|
sad when people do this https://docs.rs/http_headers/0.0.2/src/http_headers/lib.rs.html |
I've started prototyping this: https://github.com/sfackler/typed-headers |
The header API is now available through |
It seems that there is an API available through http::header, but it isn't as extensive as the one that used to be in hyper. Are there plans to change this, or is parsing header values (such as content-disposition) left to downstreams? |
I've been successfully using hyper 0.11.x with the compat feature, Paraphrased from body-image/src/client.rs: use self::hyper::header::{ContentEncoding, ContentLength,
Encoding as HyEncoding,
Header, TransferEncoding, Raw};
let encodings = headers.get_all(http::header::CONTENT_ENCODING);
for v in encodings {
if let Ok(v) = ContentEncoding::parse_header(&Raw::from(v.as_bytes())) {
for av in v.iter() {
//...
}
}
} To prepare for hyper 0.12.x and take advantage of some other niceties with tokio reform, I've started attempting the port to the master branch of hyper. The typed This issue dates from 2014 and I suspect the release and migration to the http crate satisfies the original request, but I didn't want to create a duplicate before asking. Please advise. |
I forked a hyperx crate, with the header module from 0.11.x branch (76fdbcf) and have been using this to ease my migration and testing with tokio (reform) and hyper master branch (0.12-pre). https://docs.rs/hyperx @seanmonstar please consider this as a prototype and contribution to some future official extraction of the module. So far I haven't done anything to make this play nicer with the http::header types. Edit: Add repo link: dekellum/hyperx |
Update: I've made https://github.com/hyperium/headers that pulls the 0.11.x typed headers into its own crate. The name is provisional, the purpose is just to try to consolidate effort and conversations in a single place. |
Since hyperium/headers exists and is actively being worked on, this can probably be closed, right? |
rust-ppapi
maintainer here.rust-ppapi
needs to be able to handle header formats correctly, but doesn't need all of Hyper (ie doesn't need the server + client parts). I'd like to haverust-ppapi
just depend on the header portions of hyper, because the Pepper API has it's own http client API.The text was updated successfully, but these errors were encountered: