Macro enumset::enum_set
[−]
[src]
macro_rules! enum_set { ($enum_name:ty, $($value:path)|+) => { ... }; }
Creates a EnumSet literal, which can be used in const contexts.
The format is enum_set_type!(Type, Type::A | Type::B | Type::C)
, where Type
is the type
the enum will contain, and the rest is the variants that the set will contain.
Examples
const CONST_SET: EnumSet<Enum> = enum_set!(Enum, Enum::A | Enum::B); assert_eq!(CONST_SET, Enum::A | Enum::B);