Releases: danlehmann/bitfield
Releases · danlehmann/bitfield
2.0.0 public release on crates.io
This version expects arbitrary-int 2.x.
Added
- Support for signed arbitrary-int integers as field types, e.g.
i3,i24, etc. - Added
forbid_overlapsattribute argument which checks and denies overlaps ofbitfieldfields. (@robamu) - Array support for
debugimplementation. (@robamu) - Builder
with_*setter methods can now be called in any order. This is a breaking change if you
rely on the builder's type signature not changing. The builder now has one boolean const parameter
per field in the bitfield, instead of a single numeric const parameter. (@estebank) - Builder is now available even when different fields have overlapping ranges, as long as there is
a valid subset of fields that can be independently set to cover the whole range. (@estebank)
Fixed
debuganddefmtimplementations now also allow write-only fields. However, they are skipped
with the exception ofdefmtbitfields. (@robamu)- Use fully qualified trait syntax in
defmt_bitfieldsmacro implementation, avoiding the need
for users to import thearbitrary_int::traits::Integertrait for auto-generated code. (@robamu) - Introduced a check to deny
bitfieldconfigurations where non-array fields could have out of
range offsets. (@robamu) - Breaking change: bitenum's new_with_raw_value, when used with an arbitrary-int type would previously
return the next larger whole primitive integer instead of the arbitrary-int, which was
inconsistent. This is a breaking change.
// Old type
let foo: Result<MyEnum, u8> = MyEnum::new_with_raw_value(u2::new(0b10));
// New type (notice the u2 instead of u8)
let foo: Result<MyEnum, u2> = MyEnum::new_with_raw_value(u2::new(0b10));- Generated functions in the builder now have a filled out docstring. (@estebank)
- Write-only fields in debug and defmt implementations are allowed. (@robamu)
- No longer allows out-of-bounds bit access when the underlying data type is an arbitrary-int
(e.g. abitfield(u24)no longer allows accessing bit 26). (@estebank)
Initial version on crates.io
1.0.0 Update README.md