Zig’s enums allow you to define types with a restricted set of named values.
Let’s declare an enum.
Enums types may have specified (integer) tag types.
Enum’s ordinal values start at 0. They can be accessed with the built-in
function
@intFromEnum.
Values can be overridden, with the next values continuing from there.
Enums can be given methods. These act as namespaced functions that can be called
with the dot syntax.
Enums can also be given var and const declarations. These act as namespaced
globals and their values are unrelated and unattached to instances of the enum
type.