pub struct LeafEnumBuildSpec { build: String, rules: Vec, } impl LeafEnumBuildSpec { pub fn new(build: &str, rules: Vec) -> Self { Self { build: build.to_string(), rules, } } pub fn build(&self) -> &str { &self.build } pub fn rules(&self) -> impl Iterator { self.rules.iter().map(AsRef::as_ref) } }