{"repo":"Peternator7/strum","free":true,"listed":false,"github":"https://github.com/Peternator7/strum","clone":"git clone https://github.com/Peternator7/strum.git","description":"A small rust library for adding custom derives to enums","language":"Rust","stars":2423,"topics":["strum","enum","rust","rust-lang"],"license":"MIT","category":"dev-tools","readme_excerpt":"Strum Strum is a set of macros and traits for working with enums and strings easier in Rust. Compatibility Strum is currently compatible with versions of rustc = 1.71.1. Pull Requests that improve compatibility with older versions are welcome. The project goal is to support a rust version for at least 2 years after release and even longer is preferred since this project changes slowly. Including Strum in Your Project Import strum and strum macros into your project by adding the following lines to your Cargo.toml. Strum macros contains the macros needed to derive all the traits in Strum. Strum Macros Strum has implemented the following macros: Macro Description --- ----------- [EnumString] Converts strings to enum variants based on their name. [Display] Converts enum variants to strings [FromRepr] Convert from an integer to an enum. [AsRefStr] Implement AsRef for MyEnum [IntoStaticStr] Implements From for &'static str on an enum [EnumIter] Creates a new type that iterates of the variants of an enum. [EnumProperty] Add custom properties to enum variants. [EnumMessage] Add a verbose message to an enum variant. [EnumDiscriminants] Generate a new type with only the discriminant names. [EnumCount] Add a constant usize equal to the number of variants. [VariantArray] Adds an associated VARIANTS constant which is an array of all enum discriminants [VariantNames] Adds an associated VARIANTS constant which is an array of discriminant names Contributing Thanks for your interest in contri","default_branch":null,"files":null,"tree":[],"storefront":"/r/Peternator7","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Peternator7/strum/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}