quork/traits/list.rs
1#![allow(clippy::module_name_repetitions)]
2//! Listing all Variants of an enum
3
4#[cfg(feature = "macros")]
5pub use crate::macros::ListVariants;
6
7/// A trait listing all Variants of an enum
8///
9/// This can technically be implemented for nearly anything, but it is designed for enums, in conjunction with the associated derive macro
10pub trait ListVariants<const N: usize>
11where
12 Self: Sized,
13{
14 /// All variants of the enum
15 const VARIANTS: [Self; N];
16}