[go: up one dir, main page]

enum-iterator 0.8.0

Tools to iterate over all values of a type (e.g. all variants of an enumeration)
Documentation

Overview

Tools to iterate over the values of a type.

See the [IntoEnumIterator] trait.

Example

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));

Contribute

All contributions shall be licensed under the 0BSD license.