Skip to content

consider using deku for serializing/parsing structs #150

Open
@cosmicexplorer

Description

@cosmicexplorer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions