Macro dotenv_enum::env_enum
source · macro_rules! env_enum { ($enum_name: ident, $env_test_name: ident, [$($var_name: ident), *]) => { ... }; }
Expand description
Environment Enum
This macro creates an enum and implements the trait EnvironmentVariable. It also creates tests to verify that the keys from the enums exists within the macro
use dotenv_enum::{env_enum, EnvironmentVariable};
use strum::IntoEnumIterator;
env_enum!(TheEnumNameEnv, enum_test_module, [Value]);The first value is the enum name (the suffix Env will be removed for the key value) The second value is the name of the test module The third value is a list of enum values