Derive Macro tosho_macros::EnumCount
source · #[derive(EnumCount)]
Expand description
Derives an enum that would implement ::count()
to return the number of variants
§Example
use tosho_macros::EnumCount;
#[derive(EnumCount, Clone, Debug)]
enum TestEnum {
Create,
Read,
}
assert_eq!(TestEnum::count(), 2);