Overview
Tools to iterate over the values of a type.
See the [IntoEnumIterator] trait.
Example
use IntoEnumIterator;
assert_eq!;
assert_eq!;
Contribute
All contributions shall be licensed under the 0BSD license.
Tools to iterate over the values of a type.
See the [IntoEnumIterator] trait.
use enum_iterator::IntoEnumIterator;
#[derive(Debug, IntoEnumIterator, PartialEq)]
enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }
assert_eq!(Day::into_enum_iter().next(), Some(Day::Monday));
assert_eq!(Day::into_enum_iter().last(), Some(Day::Sunday));
All contributions shall be licensed under the 0BSD license.