Skip to content
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

Make this crate usable in a no_std environment #199

Open
linkmauve opened this issue Oct 6, 2021 · 2 comments · May be fixed by #226
Open

Make this crate usable in a no_std environment #199

linkmauve opened this issue Oct 6, 2021 · 2 comments · May be fixed by #226

Comments

@linkmauve
Copy link
Contributor

#196 removed most uses of std, but as said there std::io and std::error::Error are two remaining uses of std with no no_std replacement. Here is the tracking issue: rust-lang/rust#48331

This issue is about adding an alternative API which wouldn’t use the io::Read trait for reading JPEG data, so that it could be used in embedded environments.

@fintelia
Copy link
Contributor

fintelia commented Oct 6, 2021

Do you have a sketch of what the alternative API might look like?

@vstroebel
Copy link
Contributor

One possibility to solve this, is to create your own std::io::Read alike Trait with a custom error type and implement this for everything implementing std::io::Read if std is available.
This way the same API can be used with your no_std and the std Read type.

I've use a similar approach for std::io::Write to add no_std support to the jpeg-encoder crate.

@vstroebel vstroebel linked a pull request Feb 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants