rust-string-enums
Installation
SKILL.md
Rust string enums
Use this skill when adding or changing enums represented by a single string, or surveying handwritten string conversions
Choose the representation
For an enum with fixed spellings and an unknown-string fallback, prefer strum::EnumString and strum::Display together with serde_with::DeserializeFromStr and serde_with::SerializeDisplay. Keep each wire spelling in the Strum attributes instead of repeating it in a handwritten Serde match
Strum implements string conversion traits, not Serde traits. EnumString implements FromStr; Display formats the wire string. The two serde_with derives connect those traits to Serde. AsRefStr provides a borrowed string accessor and is optional