Tags→#pattern-matching
Modeling State with Rust Enums
Use enum variants to describe valid states, carry the data each state needs, and make transitions explicit with pattern matching.
Use enum variants to describe valid states, carry the data each state needs, and make transitions explicit with pattern matching.