A simple state machine in Rust.