Replies: 1 comment
-
The following will work: #[derive(Debug, PartialEq, Clone, Copy, DekuRead, DekuWrite)]
#[deku(type = "u16")]
pub(crate) enum ResourceType {
#[deku(id = "1")]
A,
#[deku(id = "2")]
B,
#[deku(id = "3")]
C,
#[deku(id_pat = "_")]
Other(u16),
} I'm sure we could figure out something in the future to support mostly "unit-only enum" with one |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I have this enum:
What if I receive a malformed but still valid input where ResourceType enum is 4 or any other value.
How can I ignore such cases or is there a way to handle myself by checking value and ignore if needed
Beta Was this translation helpful? Give feedback.
All reactions