modular-bitfield icon indicating copy to clipboard operation
modular-bitfield copied to clipboard

Support for byte arrays

Open chemicstry opened this issue 2 years ago • 0 comments

Firstly, thanks for such a great crate! I wish I had found it sooner...

I tried searching through issues and couldn't find anything about byte arrays. Here is what I would like to use:

#[bitfield]
struct Packet {
    opcode: B6,
    status: B2,
    data: [u8; 8], // Error: `the trait bound `[u8; 8]: modular_bitfield::Specifier` is not satisfied`
    other_field: B8,
}

Is there anything fundamental to why this is not supported? If not, I could try contributing a PR for such feature.

chemicstry avatar Jan 21 '23 02:01 chemicstry