Pretty State Machine Patterns in Rust
https://hoverbear.org/blog/rust-state-machine-pattern/
Rust lets us represent State Machines in a fairly good way. In an ideal situation we'd be able to make enums with restricted transitions between variants, but that's not the case. Instead, we can harness the power of generics and the ownership system to create something expressive, safe, and understandable.
Pretty State Machine Patterns in Rust
https://hoverbear.org/blog/rust-state-machine-pattern
Rust lets us represent State Machines in a fairly good way. In an ideal situation we'd be able to make enums with restricted transitions between variants, but that's not the case. Instead, we can harness the power of generics and the ownership system to create something expressive, safe, and understandable.