Open Frostie314159 opened 1 year ago
Do you have an example of your expected behavior?
Currently I'm trying to parse radiotap headers with deku. Radiotap has a fixed header and the rest of the fields are only present, if their specific bit has been set in the header. Some of these fields are bitflags, for which I've written parser functions. In my struct they are defined as Options: ``` struct header { //...
cond="present_fields.contains(IEEE80211RadiotapFields::Flags)",
reader = "read_bitflags(deku::rest)",
writer = "write_bitflags(deku::output, &self.present_fields)")]
flags: Option\<IEEE80211RadiotapFlags\>,
//... }
I'm not sure I fully understand the question and expected behavior. Can you provide a minimal running example w/ comments which would hilight the issue?
When using a conditional field, the reader and writer functions should operate on the value of the option. And not the option itself.