this-state provides a way to store state in a thread-safe manner as well as a way to asynchronously wait for state changes.
The example below uses the following state:
````rs
enum MyState { A, B, C } ````
````rs let state = State::new(MyState::A);
let stateclone = state.clone(); tokio::spawn(async move { // do some work stateclone.set(MyState::B); // do some more work state_clone.set(MyState::C); });
state.waitforstate(MyState::C).await;
assert_eq!(state.get(), MyState::C); ````