{"id":13595380,"url":"https://github.com/Peternator7/strum","last_synced_at":"2025-04-09T13:31:47.048Z","repository":{"id":39759783,"uuid":"80964373","full_name":"Peternator7/strum","owner":"Peternator7","description":"A small rust library for adding custom derives to enums","archived":false,"fork":false,"pushed_at":"2025-04-01T18:10:33.000Z","size":543,"stargazers_count":1973,"open_issues_count":67,"forks_count":164,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-09T10:05:49.058Z","etag":null,"topics":["enum","rust","rust-lang","strum"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/strum","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Peternator7.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-05T02:50:40.000Z","updated_at":"2025-04-09T04:33:06.000Z","dependencies_parsed_at":"2023-02-08T05:31:29.825Z","dependency_job_id":"be797503-8797-49ca-97be-72f595f64c4b","html_url":"https://github.com/Peternator7/strum","commit_stats":{"total_commits":258,"total_committers":103,"mean_commits":2.504854368932039,"dds":0.7596899224806202,"last_synced_commit":"3408033e9aee44d7c57eef5d3bd414cb48b8f24d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peternator7%2Fstrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peternator7%2Fstrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peternator7%2Fstrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peternator7%2Fstrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Peternator7","download_url":"https://codeload.github.com/Peternator7/strum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049286,"owners_count":21039197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enum","rust","rust-lang","strum"],"created_at":"2024-08-01T16:01:48.977Z","updated_at":"2025-04-09T13:31:47.035Z","avatar_url":"https://github.com/Peternator7.png","language":"Rust","funding_links":[],"categories":["Rust","rust"],"sub_categories":[],"readme":"# Strum\n\n[![Build Status](https://travis-ci.com/Peternator7/strum.svg?branch=master)](https://travis-ci.com/Peternator7/strum)\n[![Build status](https://ci.appveyor.com/api/projects/status/ji4f6n2m5lvu11xt?svg=true)](https://ci.appveyor.com/project/Peternator7/strum)\n[![Latest Version](https://img.shields.io/crates/v/strum.svg)](https://crates.io/crates/strum)\n[![Rust Documentation](https://docs.rs/strum/badge.svg)](https://docs.rs/strum)\n![Crates.io](https://img.shields.io/crates/l/strum)\n![Crates.io](https://img.shields.io/crates/d/strum)\n\nStrum is a set of macros and traits for working with enums and strings easier in Rust.\n\n# Compatibility\n\nStrum is currently compatible with versions of rustc \u003e= 1.66.1. Pull Requests that improve compatibility with older\nversions are welcome. The project goal is to support a rust version for at least 2 years after release \nand even longer is preferred since this project changes slowly.\n\n# Including Strum in Your Project\n\nImport strum and strum_macros into your project by adding the following lines to your\nCargo.toml. Strum_macros contains the macros needed to derive all the traits in Strum.\n\n```toml\n[dependencies]\nstrum = \"0.27\"\nstrum_macros = \"0.27\"\n\n# You can also use the \"derive\" feature, and import the macros directly from \"strum\"\n# strum = { version = \"0.27\", features = [\"derive\"] }\n```\n\n# Strum Macros\n\nStrum has implemented the following macros:\n\n| Macro | Description |\n| --- | ----------- |\n| [EnumString] | Converts strings to enum variants based on their name. |\n| [Display] | Converts enum variants to strings |\n| [FromRepr] | Convert from an integer to an enum. |\n| [AsRefStr] | Implement `AsRef\u003cstr\u003e` for `MyEnum` |\n| [IntoStaticStr] | Implements `From\u003cMyEnum\u003e for \u0026'static str` on an enum |\n| [EnumIter] | Creates a new type that iterates of the variants of an enum. |\n| [EnumProperty] | Add custom properties to enum variants. |\n| [EnumMessage] | Add a verbose message to an enum variant. |\n| [EnumDiscriminants] | Generate a new type with only the discriminant names. |\n| [EnumCount] | Add a constant `usize` equal to the number of variants. |\n| [VariantArray] | Adds an associated `VARIANTS` constant which is an array of all enum discriminants |\n| [VariantNames] | Adds an associated `VARIANTS` constant which is an array of discriminant names |\n| [EnumTable] | *Experimental*, creates a new type that stores an item of a specified type for each variant of the enum. |\n\n# Contributing\n\nThanks for your interest in contributing. Bug fixes are always welcome. If you are interested in implementing or\nadding a macro, please open an issue first to discuss the feature. I have limited bandwidth to review new features.\n\nThe project is divided into 3 parts, the traits are in the\n`/strum` folder. The procedural macros are in the `/strum_macros` folder, and the integration tests are\nin `/strum_tests`. If you are adding additional features to `strum` or `strum_macros`, you should make sure\nto run the tests and add new integration tests to make sure the features work as expected.\n\n# Debugging\n\nTo see the generated code, set the STRUM_DEBUG environment variable before compiling your code.\n`STRUM_DEBUG=1` will dump all of the generated code for every type. `STRUM_DEBUG=YourType` will\nonly dump the code generated on a type named `YourType`.\n\n# Name\n\nStrum is short for STRing enUM because it's a library for augmenting enums with additional\ninformation through strings.\n\nStrumming is also a very whimsical motion, much like writing Rust code.\n\n[EnumString]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumString.html\n[Display]: https://docs.rs/strum_macros/latest/strum_macros/derive.Display.html\n[AsRefStr]: https://docs.rs/strum_macros/latest/strum_macros/derive.AsRefStr.html\n[IntoStaticStr]: https://docs.rs/strum_macros/latest/strum_macros/derive.IntoStaticStr.html\n[EnumIter]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumIter.html\n[EnumIs]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumIs.html\n[EnumProperty]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumProperty.html\n[EnumMessage]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumMessage.html\n[EnumDiscriminants]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumDiscriminants.html\n[EnumCount]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumCount.html\n[FromRepr]: https://docs.rs/strum_macros/latest/strum_macros/derive.FromRepr.html\n[VariantArray]: https://docs.rs/strum_macros/latest/strum_macros/derive.VariantArray.html\n[VariantNames]: https://docs.rs/strum_macros/latest/strum_macros/derive.VariantNames.html\n[EnumTable]: https://docs.rs/strum_macros/latest/strum_macros/derive.EnumTable.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeternator7%2Fstrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeternator7%2Fstrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeternator7%2Fstrum/lists"}