Macro big_enum_set::big_enum_set
source · macro_rules! big_enum_set { ( $( $value:path )|* $( | )? ) => { ... }; }
Expand description
Creates a BigEnumSet
literal, which can be used in const contexts.
The syntax used is big_enum_set!(Type::A | Type::B | Type::C)
. Each variant must be of the same
type, or a error will occur at compile-time.
Examples
const CONST_SET: BigEnumSet<Enum> = big_enum_set!(Enum::A | Enum::B);
assert_eq!(CONST_SET, Enum::A | Enum::B);
This macro is strongly typed. For example, the following will not compile:
ⓘ
let type_error = big_enum_set!(Enum::A | Enum2::B);