pub fn stringToEnum(comptime T: type, tag_name: []const u8) ?T
Returns the variant of an enum type corresponding to the provided tag name, or null if no such variant exists.
null
T: type
tag_name: []const u8
18 19 20
pub fn stringToEnum(comptime T: type, tag_name: []const u8) ?T { return std.StaticStringMap(T).initEnum().get(tag_name); }
Returns the variant of an enum type corresponding to the provided tag name, or
nullif no such variant exists.