Closed libklein closed 1 month ago
I am wondering whether it is possible to define assertions over (anonymous) tuple structs, as in the following example:
#[derive(DekuRead, DekuWrite)] #[deku(type = "u8", bits = "1")] pub enum RegisterOrValue { #[deku(id = "0b0")] Field(#[deku(assert = "*??? < 32")] u8), }
Is there some deku internal name that could be used to reference the parsed u8?
Try the following: #[deku(assert = "*field_0 < 32")] u8
#[deku(assert = "*field_0 < 32")] u8
Closing, unless this didn't work for you!
I am wondering whether it is possible to define assertions over (anonymous) tuple structs, as in the following example:
Is there some deku internal name that could be used to reference the parsed u8?