Skip to content

0.13.0

Latest

Choose a tag to compare

@wrenger wrenger released this 04 Apr 17:36

This release adds support for const generics.

Bitfields can now use const generics directly. Just declare them on the struct as usual:

use bitfield_struct::bitfield;

#[bitfield(u16)]
#[derive(PartialEq, Eq)]
struct Packet<const VERSION: u8> {
    #[bits(4)]
    tag: u8,
    #[bits(12)]
    payload: u16,
}