hyperium / http

Rust HTTP types
Apache License 2.0
1.12k stars 283 forks source link

no_std support #563

Open olanod opened 2 years ago

olanod commented 2 years ago

This PR turns the crate into no_std compatible replacing std references with core + alloc and adding the std feature where needed(std::error::Error support).
Also tried to make the dependency on HashMap optional making extensions an optional feature, the ahash dependency shouldn't be an issue since it's already a dependency of hashbrown which is the the std HashMap implementation.

jplatte commented 1 year ago

TypeId implements Ord, so how about using BTreeMap for extensions if there is no std, rather than not having it?

algesten commented 10 months ago

This looks really good. Wonder if the crate authors will get time to consider it?

algesten commented 10 months ago

Hm. I guess it doesn't get rid of allocations cause it relies on the extern crate alloc

seanmonstar commented 8 months ago

I'm not sure about getting this into 1.0, but I do want to allow for it. I think the only breaking change would be to add a std feature that is default-on, yea? Then we could eventually fix up support with it off.

algesten commented 8 months ago

Yes. I got a feeling i've seen more std feature flags than the opposite no_std. Either way works though.

seanmonstar commented 8 months ago

I created #637 which does that, allowing us to eventually add support later.

olanod commented 2 days ago

What's the current feeling about this feature, any must haves besides the basic support I initially added?