pub inline fn hasFn(comptime T: type, comptime name: []const u8) bool
pub inline fn hasFn(comptime T: type, comptime name: []const u8) bool { switch (@typeInfo(T)) { .@"struct", .@"union", .@"enum", .@"opaque" => {}, else => return false, } if (!@hasDecl(T, name)) return false; return @typeInfo(@TypeOf(@field(T, name))) == .@"fn"; }