-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Sorry, new to rust, and I might have missed something, but would it be possible to add private bitfields if they don't already exist?
pub mod foo {
#[bitfield(u8, default = 0x00)]
pub struct bar {
#[bit(0, r)]
pub cool: bool,
#[bits(1..=4, r)]
hotness: u4, // I want this to be private
#[bits(5..=7, r)]
pub weirdness: u3,
}
impl bar {
pub fn hotness(&self) -> u8 {
8 * self.hotness().value() // So hotness can be a multiple of 8
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels