There seems to be some idea out there that state machines would be hard in #Rust.
From my experience, it is pretty much the opposite:
With the decent mix of thread safety with functional and OO style features, such as encapsulating state in struct instances, it is pretty easy, but you need to understand it once, of course.
TL;DR keep an *internal* Arc<Mutex<T>> around and use it in methods - that gains you tons of capabilities.
Do operations and handle your state transforms in one place.
@CyReVolt swapping the state can be a bit of a pain with strict ownership rules. Like you may want to match on the previous state and then in the match statement take ownership of the previous state, modify it and put it back. This fails in multiple ways. I always end up adding a “Poisoned” variant to my state enum, make it the default and then std::mem::take the state before matching/modifying it.