Common Data Structures

Enumeration

Learn about Enum in the Rust programming language book
Bullet points of the enumeration

An enumeration, or enum, is a data type that allows a variable to take on one of several possible values (or states). Each of these possibilities is called a "variant." For example, in Rust, an enum can represent different states of a traffic light with variants such as Red, Yellow, and Green.

Structure

Last updated