ActionEnum

Derive Macro ActionEnum 

Source
#[derive(ActionEnum)]
Expand description

Derives ActionEnum for a given enum, automatically assigning keys based on uppercase characters in the enum variant names.

For example:

#[derive(ActionEnum)]
pub enum YesNoSkipAction {
    Yes,     // key will be Y
    No,      // key will be N
    Skip,    // key will be S
    SkipAll, // key will be A, since S is used already
}
// prompt will be the choice (Y)es/(N)o/(S)kip/Skip(A)ll