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

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

#7 in #enum-variant

Download history 98/week @ 2026-02-14 162/week @ 2026-02-21 115/week @ 2026-02-28 83/week @ 2026-03-07 116/week @ 2026-03-14 137/week @ 2026-03-21 94/week @ 2026-03-28 148/week @ 2026-04-04 213/week @ 2026-04-11 150/week @ 2026-04-18 148/week @ 2026-04-25 150/week @ 2026-05-02 135/week @ 2026-05-09

599 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

~1.5–2.4MB
~45K SLoC