-
Notifications
You must be signed in to change notification settings - Fork 301
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
no_std support #563
base: master
Are you sure you want to change the base?
no_std support #563
Conversation
Extensions are also made an optional feature to not require depending on HashMap
|
This looks really good. Wonder if the crate authors will get time to consider it? |
Hm. I guess it doesn't get rid of allocations cause it relies on the |
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 |
Yes. I got a feeling i've seen more |
I created #637 which does that, allowing us to eventually add support later. |
What's the current feeling about this feature, any must haves besides the basic support I initially added? |
@olanod I see that this PR takes into account that So it may be worth asking @seanmonstar what he thinks about either 1) accepting this as-is with Error-in-std-but-not-in-core, or 2) thinking about waiting until Tokio bumps their MSRV to at least 1.81 (which will take at least 6 months). In the event of the latter, maybe we could get no_std support merged on a beta release branch of the HTTP crate? no_std users presumably don't care about the entire Hyper/Tokio ecosystem, so it would be useful to them to have this crate available on no_std even if it's a parallel release branch from that being used by Hyper/Tokio. |
If I remember correctly, we made it so currently with feature disabled nothing compiles. So if we make it so some of it compiles without the feature, that's still just an addition. And adding the error impls back eventually would still be just an addition. Right? |
@seanmonstar That seems reasonable, yes. Although, if you're willing to allow the crate's MSRV to vary based upon whether or not the |
This PR is similar to other no-std PRs, however it takes the approach of using the new [`core::error`] module in Rust 1.81. This means that no-std mode has an MSRV of Rust 1.81, while the existing MSRV of 1.49 is still supported for existing users, as suggested [here]. This PR also preserves semver compatibility, and avoids adding any new dependencies or required features for existing users. And it avoids modifying the tests and benchmark sources, as those don't need to be no-std. And it avoids making any unrelated changes. And, it adds CI coverage and README.md documentation. [here]: hyperium#563 (comment) [`core::error`]: https://doc.rust-lang.org/stable/core/error/index.html Fixes hyperium#551.
This PR turns the crate into
no_std
compatible replacingstd
references withcore
+alloc
and adding thestd
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.