Derive Macro bevy_enum_filter_derive::EnumFilter
source · [−]#[derive(EnumFilter)]
Expand description
Derive the EnumFilter
trait on the given enum.
This will do a couple things:
- It will, of course, implement the
EnumFilter
trait - It will generate a module with filter components for each enum variant
The generated module will have the name of the enum (snake-cased), appended by
_filters
. So the enum, MyEnum
, would generate a module called my_enum_filters
.
The module will contain a zero-sized marker component struct for each variant. For example, given the following enum:
enum Foo {
Bar,
Baz(i32),
}
We would end up generating the module foo_filters
which contains the markers Bar
and Baz
.
See the Enum!
macro for how to properly use this generated module.