FunctionsΒ§
- derive_
is_ πbit_ valid - Generates an implementation of
is_bit_validfor an arbitrary enum. - generate_
tag_ πconsts - Generates a constant for the tag associated with each variant of the enum. When we match on the enumβs tag, each arm matches one of these constants. We have to use constants here because:
- generate_
tag_ πenum - Generates a tag enum for the given enum. This generates an enum with the
same non-align
reprs, variants, and corresponding discriminants, but none of the fields. - generate_
variant_ πstructs - Generates variant structs for the given enum variant.
- generate_
variants_ πunion - tag_
ident π - variant_
struct_ πident