Module enum

Module enum 

Source

FunctionsΒ§

derive_is_bit_valid πŸ”’
Generates an implementation of is_bit_valid for 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 πŸ”’