-
Notifications
You must be signed in to change notification settings - Fork 6
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
#7
Conversation
Also implement our own bare-bones version of Ipv{4,6}Addr
Thank you for the nice work! As for replacing Also, would you place the |
Oh, I totally missed this. That is fantastic! I will remove my bare-bones stuff and replace them with just
Absolutely. I'll add the flag where needed. |
This commit prepares for the eventual release of `core::net` in 1.69
It is currently in a "broken" state, since we are waiting for the next stable release. I made sure it worked using nightly. If you want to test right now use nightly with the flag |
Thanks for the adjustments! I've just added |
Wait a minute. I seem to have mistakenly assumed that the IUUC, the I should've asked this in the very beginning, but I wonder what your use case of |
Oof, yes. It seems like #108443 is what is keeping track of the stabilization progress. Well, at least we know that sometime in the future the entire crate can be
I can't believe I didn't think of just removing the address fields. 😖 My use case would be parsing URIs on embedded devices which don't have an OS, and as such cannot use Would removing the IP address fields make the parser not be able to parse IP addresses? I could easily just feature-gate the two fields behind the |
It wouldn't, so long as we retain all the IP address parsing code except the part that turns an IP address into By the way, I've already incorporated the changes that remove the fields in the branch |
I have to the best of my ability ported changes that should not break anything. You may want to double-check so I did not break any public-facing stuff. I included some of the small changes you did to the parser. I left the features as they were since removing them would be breaking changes. |
Thanks for the pull request! I have published a new release of version |
This PR adds
no_std
support to the crate by replacing all explicit uses ofstd
withcore
oralloc
. Thus, closes #6.I removed all
Error
implementations from custom errors, since theError
trait still hasn't landed incore
yet, see 103765.I have replaced the
std::net::Ipv{4,6}Addr
structs with very bare-bones versions based on the ones in the standard library. Their implementations might leave something to be desired, and I am open to suggestions on if even having them is necessary. One could replace all instances of their use with just some byte arrays representing the ip addresses, feature-gate them or just leave out them all together.I have not added a feature-gate for them for the moment, but if desired it is easily done.
This is a fairly brute-force-y way of doing things, so it exposes some extra things as part of the API and may cause some breakage if people are relying on the
std::net
IP structs.