Get Me a Job
We’ve seen primitive types, like
str. We’ve seen structs, which let you create more complex types by combining other types. Now it’s time to introduce a third kind of type,
enums. These let you create something that may be one of many different things. We’ll start with simple examples, then build up more sophisticated cases.
We’ve played around with a
Person for a while now. We’ve given this person fields like name and age. Let’s add a new field, the person’s job. The question is, how do we represent a job? One way would be to use a