Function intToEnum [src]
Deprecated: use std.enums.fromInt instead and handle null instead of an error.
Prototype
pub fn intToEnum(comptime EnumTag: type, tag_int: anytype) IntToEnumError!EnumTag Parameters
EnumTag: type Possible Errors
Source
pub fn intToEnum(comptime EnumTag: type, tag_int: anytype) IntToEnumError!EnumTag {
return std.enums.fromInt(EnumTag, tag_int) orelse return error.InvalidEnumTag;
}