Skip to content

Commit 9452ba1

Browse files
ian-h-chamberlainemilio
authored andcommitted
Mention blocklisting bitfield types in book
1 parent 0e4a5cc commit 9452ba1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

book/src/using-bitfields.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ As Rust does not support bitfields, Bindgen generates a struct for each with the
88
* For each contiguous block of bitfields, Bindgen emits an opaque physical field that contains one or more logical bitfields
99
* A static constructor ```new_bitfield_{1, 2, ...}``` with a parameter for each bitfield contained within the opaque physical field.
1010

11+
To keep bindgen from generating the bitfield unit struct, it can be blocklisted like any
12+
other type, i.e. `--blocklist-type "__BindgenBitfieldUnit"`. This may be useful if
13+
you want to define a custom implementation, or your generated bindings import a
14+
pre-existing definition for the bitfield unit type.
15+
1116
## Bitfield examples
1217

1318
For this discussion, we will use the following C type definitions and functions.

0 commit comments

Comments
 (0)