Skip to content

refactor proposal, replace manual ser/der with auto generated #8

@dvdsk

Description

@dvdsk
  • Improves readability
  • Eliminates offset/cast/masking errors
  • Speeds up further development

Implementation steps:

  • Replace the serialize/deserialize functions for structs representing bitfields (1) with proc-macro annotations.
  • Build a custom serde data format, implement it for the remaining structs (I did this for zstacker and it worked great.

I have looked at all the bitfield crates, I think bilge is a great fit. It handles enums well. The crate bitbybit would work too.

I would not mind taking a go at implementing this. We could do one bitfield first to see what it would look like.

(1): such as

pub fn deserialize(bytes: &[u8]) -> Result<(Self, &[u8]), &'static str> {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions