Trait every_variant::EveryVariant [−][src]
pub trait EveryVariant: Sized { fn every_variant() -> Vec<Self>; fn for_every_variant<F: Fn(&Self)>(closure: F) { ... } }
Expand description
Trait that supplies a function to generate a vector containing all possible variants in a tree
Required methods
fn every_variant() -> Vec<Self>
fn every_variant() -> Vec<Self>
A vector of variants that should contain every possible variant of the struct or enum
Provided methods
fn for_every_variant<F: Fn(&Self)>(closure: F)
fn for_every_variant<F: Fn(&Self)>(closure: F)
Helper function, loops of each variant in an enum. Else does nothing.