- Reusing code between states.
- Making callbacks to other APIs during state changes.
I ended up using the standard state pattern described here:
https://doc.rust-lang.org/book/ch17-03-oo-design-patterns.ht...The state pattern is not considered to be idiomatic Rust, but in my experience it works better and is very flexible.
The state pattern has the downside that the type system does not enforce which state changes are allowed.