It appears there is no way to have bitfields in Rust (I could be missing something) which means I would have to manually emulate them with shifts, masks, etc which is error prone and tedious.
What is the current recommended practice for emulating bitfields in Rust?
Context: I’m (attempting to) map hardware memory into Rust data structures. More often than not, the hardware breaks down words into different bit ranges, where different ranges control different functionality. This is relatively easy to handle in C, since you can just define a structure that mirrors this layout (obviously taking care to handle endienness etc) and then manipulate using reads / writes of the structure field.