Function enum_iterator::all

source ·
pub fn all<T: Sequence>() -> All<T> 
Expand description

Returns an iterator over all values of type T.

§Example

use enum_iterator::{all, Sequence};

#[derive(Debug, PartialEq, Sequence)]
enum Color { Red, Green, Blue }

assert_eq!(
    all::<Color>().collect::<Vec<_>>(),
    [Color::Red, Color::Green, Color::Blue],
);