Function enum_iterator::first

source ·
pub fn first<T: Sequence>() -> Option<T>
Expand description

Returns the first value of type T.

Same as Sequence::first.

Example

use enum_iterator::{first, Sequence};

#[derive(Debug, PartialEq, Sequence)]
enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }

assert_eq!(first::<Day>(), Some(Day::Monday));