A C-Style Enum


The following simpleenum program shows Rust's equivalent of a C-style enum: a type whose variants are just names and hold no data. Unlike in C, a Rust enum can also have methods, which are defined in an impl block just like the methods of a struct.

This zip file contains the complete crate.

src/main.rs