-
Notifications
You must be signed in to change notification settings - Fork 21
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
#33
Comments
Interesting crate! I'm just a bit worried that it has no users on crates.io apparently. I wonder if there are crates that do the same with more users. |
There's also The |
|
That could work relatively elegantly, too. After all, the core parsing logic is mostly concerned with memory buffers than calling I/O. When targeting std it would be possible to create a blanket implementation for the custom traits to delegate the operations to the real On a side note, I'm thinking it's a bit sad that there are no good off-the-shelf solutions for the seemingly basic problem of byte source and sink abstractions for non-std environments, but I guess if we do it right a worth-publishing subcrate may spawn, and compete with the other solutions. |
The |
The types provided by the The problem would then be handling I/O from other sources, which I think it's important on embedded devices with constrained memory that can't afford to just read everything to RAM. I think we could extend the idea of the custom trait blanket implementations to be able to read from any type that implements |
The issue is if the end of the buffer is reached, which can occur with corrupted data. |
As mentioned in #32 (comment), it'd be nice to make this crate work with
#![no_std]
, which would allow its usage by embedded developers or other freestanding environments. Moreover, as this requires carefully choosing any dependencies, those that use the crate instd
environments will benefit from reducing their number as well, slightly speeding up build times.An obvious first start would be getting rid of the
byteorder
dependency, as the core library of the MSRV, which is also available in no#![no_std]
, already contains methods to convert between bytes and integers.Getting rid of the
Read
andWrite
traits is a bit more involved. However, some days ago I've stumbled upon theacid_io
crate, which provides suitable, drop-in replacements for these traits. Using conditional compilation and feature flags to choose betweenacid_io
's traits and thestd
ones is easy enough to be worth a try, in my opinion.The text was updated successfully, but these errors were encountered: