pub trait Enumoid: Sized {
type Word: RawSizeWord;
const SIZE: usize;
const FIRST: Self;
const LAST: Self;
// Required method
fn into_word(self) -> Self::Word;
// Provided methods
fn from_word(value: Self::Word) -> Option<Self> { ... }
fn next(self) -> Option<Self> { ... }
fn prev(self) -> Option<Self> { ... }
fn next_wrapped(self) -> Self { ... }
fn prev_wrapped(self) -> Self { ... }
fn iter( ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ { ... }
fn iter_until(
until: Self,
) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ { ... }
fn iter_from(
from: Self,
) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ { ... }
fn iter_from_until(
from: Self,
until: Self,
) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ { ... }
}
Expand description
Trait for enumerable types.
Some members are hidden. Impls should only be defined via the Enumoid
derive macro.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
fn from_word(value: Self::Word) -> Option<Self>
fn next(self) -> Option<Self>
fn prev(self) -> Option<Self>
fn next_wrapped(self) -> Self
fn prev_wrapped(self) -> Self
fn iter() -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ
fn iter_until( until: Self, ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ
fn iter_from( from: Self, ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ
fn iter_from_until( from: Self, until: Self, ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self> ⓘ
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.