Trait otter_api_tests::shapelib::IntoEnumIterator [−][src]
This trait designates that an Enum
can be iterated over. It can
be auto generated using strum_macros
on your behalf.
Example
// You need to bring the type into scope to use it!!! use strum::{EnumIter, IntoEnumIterator}; #[derive(EnumIter, Debug)] enum Color { Red, Green { range: usize }, Blue(usize), Yellow, } // Iterate over the items in an enum and perform some function on them. fn generic_iterator<E, F>(pred: F) where E: IntoEnumIterator, F: Fn(E), { for e in E::iter() { pred(e) } } generic_iterator::<Color, _>(|color| println!("{:?}", color));
Associated Types
Loading content...Required methods
Loading content...Implementors
impl IntoEnumIterator for StaticUser
[src]
type Iterator = StaticUserIter
fn iter() -> StaticUserIterⓘNotable traits for StaticUserIter
impl Iterator for StaticUserIter type Item = StaticUser;
[src]
Notable traits for StaticUserIter
impl Iterator for StaticUserIter type Item = StaticUser;