Macro enumset::enum_set_type [−][src]
macro_rules! enum_set_type { ($(#[$enum_attr:meta])* pub enum $enum_name:ident { $($(#[$attr:meta])* $variant:ident),* $(,)* } $($rest:tt)*) => { ... }; ($(#[$enum_attr:meta])* enum $enum_name:ident { $($(#[$attr:meta])* $variant:ident),* $(,)* } $($rest:tt)*) => { ... }; () => { ... }; }
Defines enums which can be used with EnumSet.
While attributes and documentation can be attached to the enum variants, the variants may not contain data.
Copy
, Clone
, PartialOrd
, Ord
, PartialEq
, Eq
, Hash
, Debug
,
Sub
, BitAnd
, BitOr
, BitXor
, and Not
are automatically derived for the enum.
These impls, in general, behave as if the enum variant was an EnumSet
with a single value,
as those created by EnumSet::only
.
Examples
enum_set_type! { enum Enum { A, B, C, D, E, F, G } /// Documentation pub enum Enum2 { A, B, C, D, E, F, G, #[doc(hidden)] __NonExhaustive, } }