Function enum_iterator::next

source ·
pub fn next<T: Sequence>(x: &T) -> Option<T>
Expand description

Returns the next value of type T or None if this was the end.

Same as Sequence::next.

§Example

use enum_iterator::{next, Sequence};

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

assert_eq!(next(&Day::Friday), Some(Day::Saturday));