Macro eset::derive_eset
source · macro_rules! derive_eset { ($expr: ty) => { ... }; }
Expand description
An opt-in derive that adds Into<ESet<T>>
for T and operator BitOr<T, Output=ESet<T>>
.
This supports T as the right hand side for ESet
operations like |
or &=
.
You can use methods like insert
or with
instead of this macro.
Examples
enum A {
Foo,
Bar,
}
derive_eset!(A);
assert_eq!(A::Foo | A::Bar, ESet::new_flags([A::Foo, A::Bar]));