move names into separate vec with origins make struct fields a vec, resolve into index inner values that auto generate map function: enum Thing { A(T), B(T, T), C } or #[derive(Map(T))] enum Thing { ... } {([< std::Option:(u32)::Some(3) func:(u32)("hello", test, 3); std::Option:[u32]::Some(3) func:[T]("hello", test, 3); std::Option::::Some(3) func::(3) std.Option.[u32].Some(3) func.[T]("hello", test, 3); std::Option:::Some(3) func:(3)