Skip to main content

EnumIter

Trait EnumIter 

Source
pub trait EnumIter
where Self: Sized,
{ // Required method fn variants() -> Vec<Self>; }
Expand description

Allows collecting all variants of an enum.

See also the IntoEnumIterator trait of the strum crate for a version which can be automatically derived.

Required Methods§

Source

fn variants() -> Vec<Self>

Returns a vector containing all variants of the enum.

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.

Implementations on Foreign Types§

Source§

impl EnumIter for bool

Source§

fn variants() -> Vec<Self>

Implementors§