| ... | @@ -243,3 +243,12 @@ pub fn containsString(haystack: []const string, needle: string) bool { | ... | @@ -243,3 +243,12 @@ pub fn containsString(haystack: []const string, needle: string) bool { |
| 243 | } | 243 | } |
| 244 | return false; | 244 | return false; |
| 245 | } | 245 | } |
| | 246 | |
| | 247 | pub fn FieldsTuple(comptime T: type) type { |
| | 248 | const fields = std.meta.fields(T); |
| | 249 | var types: [fields.len]type = undefined; |
| | 250 | for (fields) |item, i| { |
| | 251 | types[i] = item.field_type; |
| | 252 | } |
| | 253 | return std.meta.Tuple(&types); |
| | 254 | } |