You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bits: int parameter to the #[bitfield] macro which allows to precisely control the resulting bit width
of the generated bitfield struct. Use it like: #[bitfield(bits = 5)].
Replace #[bitfield(specifier = true)] syntax with #[bitfield] #[derive(BitfieldSpecifier)].
Semantics of the new syntax is the same as the old.
It is now possible to flag fields of #[bitfield] structs with #[skip(..)] in order to skip code generation for them.
There are possibilities to skip code generation of only setters using #[skip(setters)], only getters #[skip(getters)]
or both. Having no arguments (e.g. just #[skip]) defaults to skipping both setters and getters.
A neat trick is to specify double wildcards as identifiers for skipped fields to avoid having the need to come up with
an identifier for them: For example: #[skip]: __: B10
Attributes applied to #[bitfield] fields are now properly propagated to their generated getters and setters.
Note thought that it might be confusing that an attribute applied to a struct field is actually applied to a function
through macro expansion.
Fixed several bugs and significantly improved error reporting for #[bits = N] field attributes for #[bitfield] fields.
Minor fixes and improvements to code generation:
The automatically implemented #[derive(Debug)] now produces code that the Rust 2015 edition will accept.