bitfield
This crate provides macros to generate bitfield-like struct.
0.19.5
31M downloads/mo
#1647 most downloaded on crates.io
dzamlo/rust-bitfield
What this package is like to depend on
Last release 29 days ago
25 Jul 2026
Ships unpredictably
gaps range from 4 weeks to 3.1 years
Some releases are documented
notes for 14 of 34 stable releases
1 version withdrawn
withdrawn after publishing
12 years old
35 releases · first in 2014
3 releases in the last 12 months
see the full history below
Release timeline
35 releases · Nov 2014 to Jul 2026Releases
latest 35-
0.19.525 Jul 2026Release notes
Open source →Added
- Include the Apache 2.0 and MIT license files in the
bitfield-macrospackage.
Changed
- Explain the MSB and LSB abbreviations in the README.
- Upgrade
bitfield-macrostosyn3. - Reduce stack usage in the
bitfield-macrosparser by boxing large enum variants.
- Include the Apache 2.0 and MIT license files in the
-
0.19.416 Nov 2025Release notes
Open source →Added
- Support
try_intokeyword in field definition to useTryIntoinstead ofInto
Fixed
- Print the correct error message on incorrect use of the
implinno_stdcrates, thanks to @stop5 for reporting and proposing the fix
- Support
-
0.19.310 Oct 2025Release notes
Open source →Added
- In debug mode, check that msb >= lsb in the default
BitRange/BitRangeMutimplementations and show a more helpful message than before if this is the case, thanks to @blaine-dodson for reporting - Mention MSB and LSB ordering in the readme
- Explain sign extension and valid range of signed field in the readme
- In debug mode, check that msb >= lsb in the default
-
0.19.224 Aug 2025Release notes
Open source →Fixed
- Allow usage of a signed int types for the base of newtype, thanks to @FeeeeK
-
0.19.114 May 2025 -
0.19.023 Feb 2025Release notes
Open source →Fixed
- Allow to specify an array of bools.
Breaking Changes
- If the type of an array field is exactly
bool, then theBit/BitMuttraits are used instead ofBitRange/BitRangeMut. In some very unlikely case where the traits are implemented manually, this may break existing code.
-
0.18.129 Jan 2025Release notes
Open source →Fixed
- Don't use
__bitfield_*macros from the code generated by the proc-macros. Otherwise, they need to be imported by the calling code. - Allow
mask,fromandìntoas getter names.
- Don't use
-
0.18.027 Jan 2025Release notes
Open source →Fixed
- With the new proc macro implementation some corner-cases that were not handled are now handled correctly.
Breaking Changes
- The syntax to create a constructor by specifying individual fields has been removed.
- Some syntax that was supposed to be internal and implementation details are now rejected.
-
0.17.008 Sep 2024Release notes
Open source →Breaking Changes
- Changes published as 0.16.2 (version now yanked) was breaking
-
0.16.207 Sep 2024 withdrawnRelease notes
Open source →Added
- Allow creating bitfield structs with arbitrary visibilities, thanks to @ADSteele916
-
0.16.125 Jul 2024Release notes
Open source →Added
- Implement bitwise operations for all array-Like inner types, using
AsRef/AsMut, thanks to @PokeJofeJr4th - Allow to derive constructors, thanks to @PokeJofeJr4th
- Implement bitwise operations for all array-Like inner types, using
-
0.16.022 Jul 2024Release notes
Open source →Added
- Easily Derive Bitwise Operations, thanks to @PokeJofeJr4th
Breaking Changes
- The minimum rustc version is now 1.79.0
-
0.15.009 Apr 2024Release notes
Open source →Added
- Allow to generate mask for a field
Breaking Changes
- The minimum rustc version is now 1.46.0
-
0.14.011 Jul 2022Release notes
Open source →Added
- Getters work with immutable Data
Breaking Changes
- The minimum rustc version is now 1.31.0
- The setters of the
BitRangeandBithas been separated in theBitRangeMutandBitMuttraits.
-
0.13.227 May 2019Release notes
Open source →Added
from intocan be used in place offromto change the input type of the setter. Thanks to @roblabla
-
0.13.126 Oct 2018Nothing published for this version
-
0.13.006 May 2018Nothing published for this version
-
0.12.222 Apr 2018Nothing published for this version
-
0.12.115 Oct 2017Nothing published for this version
-
0.12.021 Jul 2017Nothing published for this version
-
0.11.020 Jul 2017Nothing published for this version
-
0.10.018 Jul 2017Nothing published for this version
-
0.0.1328 Apr 2017Nothing published for this version
-
0.0.1218 Apr 2017Nothing published for this version
-
0.0.1106 Jan 2017Nothing published for this version
-
0.0.1026 Nov 2016Nothing published for this version
-
0.0.927 Oct 2016Nothing published for this version
-
0.0.803 Jul 2016Nothing published for this version
-
0.0.731 May 2016Nothing published for this version
-
0.0.621 Apr 2016Nothing published for this version
-
0.0.520 Apr 2016Nothing published for this version
-
0.0.419 Apr 2016Nothing published for this version
-
0.0.314 Feb 2016Nothing published for this version
-
0.0.212 Jan 2016Nothing published for this version
-
0.0.120 Nov 2014Nothing published for this version