Enum Rotate
Treat your enums as iterators.
This crate provides the EnumRotate
trait along with the accompanying derive macro allowing you to
- Get the next and previous variant for any variant of an enum
- Iterate over variants of an enum in a predefined (and customizable) order
- Iterate over variants of an enum starting from a particular variant
Usage
use EnumRotate;
use *;
It is also possible to specify a custom iteration order for the enum variants.
use EnumRotate;
use *;