-
Notifications
You must be signed in to change notification settings - Fork 618
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 #1184
Comments
Depending |
This issue is even harder than it might initially seem because the |
Is it possible to feature gate any code that requires |
It's not just the methods but even the ubiquitous This is however useful to plan for |
Any further advancements? :) We may provide operation system only APIs under |
Supporting byte slices in a separate interface is definitely a possible avenue for |
I don't know exact, but embedded-graphics::image has provided with a possible approach. And there are simple file system drivers like embedded-sdmmc where further abstractions could be made. We may not use |
Yep, the important part would be that there needs to be a way to support both. In particular, many of our decoder structures look like so: struct Decoder<R> {
reader: R,
// .. other fields
}
impl<R: io::Read> Decoder<R> {
fn decode(&mut self, into: &[u8]) -> io::Read<R> { … }
} Now, we can modify the inner parts of the struct (e.g. turn
because it would collide with the other impl for byte slices. |
As an additional remark, we could make a major version bump for this feature. However, we shouldn't make more than one imo. That is, any design that requires a major version bump should at least consider and if possible explicitely state:
|
Is this something that has been investigated at this point? To explain the problem concretely, in I don't have any recommendations on how to achieve this, just that it is of interest. |
The non-io portion of passing images in memory is indeed being investigated in |
Hello, I'm revisiting this b/c I needed to use this crate(or rather So I am now trying to rewrite/cleanup my fork for proper tests results `cargo test --no-default-features`
Would you be interested in a PR? Note: it still needs more work: I had to butcher I'm open to feedback! edit: instead of deactivating all |
One thing to be aware of is that there's been talk about moving |
core::error::Error is scheduled to be stabilized in Rust 1.81. One step closer to no_std compatibility. |
I would like
image
to support no_std.I am using it in the
akaze
crate. To be able to support embedded robotics/drone targets, it needs to support no_std. However,image
is used for the input types to integrate into the ecosystem more cleanly.This is important for utilizing image across the whole ecosystem, including in embedded targets, where they may have images coming in from attached cameras or even just when reading/writing images being sent over a bus to a screen.
The most basic way to implement this functionality is just to create a
std
feature that is included by default to allow backwards compatibility. This feature would gate all functions that are specific to an OS. This includesimage::open
, which can only execute with a file system.I would also recommend adding a GitHub action to test that no_std support actually works in CI. A good example of this is in some crates I have recently worked on such as
eight-point
.The text was updated successfully, but these errors were encountered: