fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int

Given a type and a name, return the field index according to source order. Returns null if the field is not found.

Parameters

T: type,
name: []const u8,