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

Read from a std::io Read + Seek and output to a Write #105

Closed
sharksforarms opened this issue Sep 29, 2020 · 3 comments
Closed

Read from a std::io Read + Seek and output to a Write #105

sharksforarms opened this issue Sep 29, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@sharksforarms
Copy link
Owner

sharksforarms commented Sep 29, 2020

Reader functions can take in a Read + Seek trait impl, write can write to a Write

#100

Feature gated under "std" feature as these are std traits.

For nostd, maybe need to wait for: rust-lang/rust#48331

References:
https://doc.rust-lang.org/std/io/trait.Read.html
https://doc.rust-lang.org/std/io/trait.Write.html
https://doc.rust-lang.org/std/io/trait.Seek.html

@sharksforarms sharksforarms changed the title Implement std::io Read, Write and Seek traits Accept a std::io Read + Seek and output to a Write Oct 9, 2020
@sharksforarms sharksforarms changed the title Accept a std::io Read + Seek and output to a Write Read from a std::io Read + Seek and output to a Write Oct 9, 2020
@TheWillard
Copy link

I'm curious on how this could be implemented, since this feature would really help in some of my projects.
If I'm not mistaken, bitvec is just a wrapper around a Vec, my guess is that we would need to replace it with something like https://github.com/tuffy/bitstream-io or with a trait that is implemented for bitvec and bitstream-io.
Or maybe I'm missing a simpler solution?

@XVilka
Copy link

XVilka commented May 6, 2023

Having this out of the box would really make use of deku easier.

@wcampbell0x2a
Copy link
Collaborator

Closing, this is now in released deku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants