Rust’s Enums Explained

Oliver Jumpertz
7 min readMay 7, 2023
Rust’s Enums Explained

In programming, an enumerated type is a type that consists of a set of values. This basically makes them a union. Many programming languages thus provide something like enums for developers to use. In many of these languages, enums are only a type alias over an integer or a string.

Rust takes enums a whole level further by providing developers with variadic types that can actually contain other types and be as different…

--

--