`#[derive(EnumSetType)]` can only be used on fieldless enums
Can we make EnumSet work on enums with fields where the fields impl EnumSetType?
E.g.
#[derive(EnumSetType)]
enum MyEnum {
A
B(MyEnumInner)
}
#[derive(EnumSetType)]
enum MyEnumInner {
C
D
}
Currently this works on MyEnumInner but not on MyEnum.
This is unfortunately very hard to implement, and unlikely to change soon. However, it is possible to do and I do plan to do it eventually.
@KaranJain21
For a workaround, consider using https://crates.io/crates/enum-kinds.
Update 1:
apparently, it's not a solution because there are conflicting implementations.
Update 2:
I opened an issue there https://github.com/Soft/enum-kinds/issues/11.
Update 3:
Apparently, there's also kinded crate, which is probably better than enum-kinds but also has the problem with conflicting implementations.
Update 4:
I've made a PR to kinded that adds an option to opt-out of default derives. So now my fork of kinded and the original enumset are compatible. Based on my observations, kinded is not actively maintained. However, the author of the crate is in my friend list of LinkedIn so I should be able to get in contact with him.
@Lymia Consider referencing the kinded crate in the Limitations section of the documentation and consider adding an option to opt-out of default derives so that your crate is more compatible with others.
@JohnScience This feature should already with the #[enumset(no_super_impls)] and #[enumset(no_ops)] options.