#enums #enum-variant #handy #json #serde

evutils

Handy helper utilities for working with enum variants

2 releases

Uses new Rust 2024

0.1.1 Feb 17, 2026
0.1.0 Feb 16, 2026

#2149 in Encoding

Download history 160/week @ 2026-04-15 161/week @ 2026-04-22 142/week @ 2026-04-29 163/week @ 2026-05-06 164/week @ 2026-05-13 145/week @ 2026-05-20 92/week @ 2026-05-27 92/week @ 2026-06-03 64/week @ 2026-06-10 8/week @ 2026-06-17 40/week @ 2026-06-24 61/week @ 2026-07-01 18/week @ 2026-07-08 54/week @ 2026-07-15 167/week @ 2026-07-22 76/week @ 2026-07-29

325 downloads per month

MIT license

6KB
64 lines

Enum variant utils

Handy utilities for working with Rust enums.

  • VariantDef - automatically define a const struct to make metadata about your enum variants available in a consistent way
  • IsVariant - quickly check if something is an instance of a specific variant
  • VariantName - quickly get (just) the variant name
  • VariantPropsToJsonArray - get the variants properties as a Vec<serde_json::Value>

More tools and detailed docs to follow soon.

Dependencies

~2.6–3.5MB
~71K SLoC