Trait Enumoid

Source
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§

Source

const SIZE: usize

Source

const FIRST: Self

Source

const LAST: Self

Required Associated Types§

Source

type Word: RawSizeWord

Required Methods§

Source

fn into_word(self) -> Self::Word

Provided Methods§

Source

fn from_word(value: Self::Word) -> Option<Self>

Source

fn next(self) -> Option<Self>

Source

fn prev(self) -> Option<Self>

Source

fn next_wrapped(self) -> Self

Source

fn prev_wrapped(self) -> Self

Source

fn iter() -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self>

Source

fn iter_until( until: Self, ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self>

Source

fn iter_from( from: Self, ) -> Map<<Self as Enumoid>::WordRange, fn(<Self as Enumoid>::Word) -> Self>

Source

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.

Implementors§