derive-enum-all-values
About
A procedural derive macro which exposes a method named all_values that returns all defined values as a compile-time static.
Usage
Add derive-enum-all-values to your Cargo.toml:
[]
= "0.1.0"
And then derive AllValues for your enum:
use AllValues;
This macro generates the following code:
A static, compile time known array containing every enum value.
Development
How to develop this project.
Clone this Repository:
# When cloning, make sure symlinks are enabled
Install Rust:
- Install the Rust Toolchain.Setup IDE
- This repository is fully with VSCode. Guidance below.
Visual Studio Code Integration
Code/VSCode is the de-facto Rust development environment.
The following extensions are required:
- rust-analyzer for Rust support.
- coverage-gutters for Coverage support.
- CodeLLDB for debugging.
- crates easier dependency management.
The VSCode configuration in Reloaded projects (.vscode) contain the following:
- Run Rust linter
clippyon Save. - Run code format
rustfmton Save. - Tasks for common operations (generate documentation, active CI/CD etc.).
These configurations are in the .vscode folder; and the tasks can be ran via Ctrl+Shift+P -> Run Task.
File Layout
The following is the expected file layout for your project:
.vscode/
src/
Cargo.toml
The src folder should contains all source code for your project.
Cargo.toml should be in the root of the project.
Contributing
See CONTRIBUTING for guidance on how to contribute to this project.
License
Licensed under MIT.