The enum keyword can also define a tagged union, which can be viewed
as an enhanced enumerated type.
A tagged union defines variants instead of values.
Each Variant can have zero or more associated types.
Tagged unions are useful in many cases, in particular for defining various & heterogeneous error types for an application. For instance the following code defines an error type and several error variants with nothing in common:
enum MyError {
ProcessingFailure(String),
UnknownPath(std::path::PathBuf),
WrongNumberOfElements(u32),
WrongSize(u16, u16),
}