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

consider using deku for serializing/parsing structs #150

Open
cosmicexplorer opened this issue May 24, 2024 · 0 comments
Open

consider using deku for serializing/parsing structs #150

cosmicexplorer opened this issue May 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cosmicexplorer
Copy link
Contributor

Problem

#93 is super cool, but adds a lot of boilerplate parsing code. This has been abstracted into the Block trait from that PR, but there's a lot of tricky bits with endianness, and it's been taking lots time and effort to become mergeable.

Proposed Solution

Deku (https://github.com/sharksforarms/deku) performs the process of byte-level serialization, and has specific handling for endianness. It also recently implemented std::io::{Read,Write} traits (see https://docs.rs/deku/latest/deku/#read-supported), which should cover the entire functionality of the Block trait and the {from,to}_le! macros introduced in #93.

Expected Result

We may be able to remove a lot of boilerplate code while retaining (or maybe exceeding?) the performance benefits of #93 by delegating that work to the deku crate.

@cosmicexplorer cosmicexplorer added the enhancement New feature or request label May 24, 2024
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

1 participant