Assert for tuple enum
libklein opened this issue · comments
Patrick Klein commented
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?
Emmanuel Thompson commented
Try the following: #[deku(assert = "*field_0 < 32")] u8