Trait Iterable

Source
pub trait Iterable {
    type Iter: Iterator;

    // Required method
    fn variants() -> Self::Iter;
}
Expand description

Derive this trait for an enum automatically using #[derive(EnumIter)]

Required Associated Types§

Source

type Iter: Iterator

The type of the iterator

Required Methods§

Source

fn variants() -> Self::Iter

Constructs an iterator that iterates over every variant in the defined order

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§