[−][src]Trait graph_rs_sdk::oauth::IntoEnumIterator
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::IntoEnumIterator; #[derive(EnumIter,Debug)] enum Color { Red, Green { range:usize }, Blue(usize), Yellow, } // Iterating over any enum requires 2 type parameters // A 3rd is used in this example to allow passing a predicate fn generic_iterator<E, I, F>(pred: F) where E: IntoEnumIterator<Iterator=I>, I: Iterator<Item=E>, F: Fn(E) { for e in E::iter() { pred(e) } } fn main() { generic_iterator::<Color,_, _>(|color| println!("{:?}", color)); }
Associated Types
Loading content...Required methods
Loading content...Implementors
impl IntoEnumIterator for GrantRequest
[src]
impl IntoEnumIterator for GrantType
[src]
impl IntoEnumIterator for OAuthCredential
[src]
impl IntoEnumIterator for Algorithm
[src]
type Iterator = AlgorithmIter
pub fn iter() -> AlgorithmIterⓘNotable traits for AlgorithmIter
impl Iterator for AlgorithmIter type Item = Algorithm;
[src]
Notable traits for AlgorithmIter
impl Iterator for AlgorithmIter type Item = Algorithm;