Trait enumoid::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 Types§

source

type Word: RawSizeWord

Required Associated Constants§

source

const SIZE: usize

source

const FIRST: Self

source

const LAST: Self

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>

Object Safety§

This trait is not object safe.

Implementors§