#![no_std]
mod generic;
mod impls;
mod iter;
use core::num::NonZeroUsize;
pub use generic::GenericEnum;
pub use iter::{iter_each, iter_each_from, IterEachFrom};
pub trait Enum: Clone {
const CARD: Option<usize>;
fn to_index(&self) -> Option<usize>;
fn from_index(i: usize) -> Option<Self>;
fn first() -> Option<Self>;
fn last() -> Option<Self>;
fn prev(&self) -> Option<Self>;
fn succ(&self) -> Option<Self>;
fn count_from(from: &Self) -> Option<NonZeroUsize>;
fn fold_each<B, F>(init: B, f: F) -> B
where
F: FnMut(B, Self) -> B;
fn fold_each_from<B, F>(from: &Self, init: B, f: F) -> B
where
F: FnMut(B, Self) -> B;
}