4 ms·
Maybe I'm missing something, but it seems that this approach doesn't allow you to store external input that's provided when you transition states. Say stateB i
by mijoharas 2y ago
Maybe I'm missing something, but it seems that this approach doesn't allow you to store external input that's provided when you transition states.
Say stateB is transitioned to from stateA and needs to store a value that is _not_ directly computed from stateA but is externally supplied at the point of transition.
As far as I understand this isn't possible with the proposed solution? Am I missing something? This seems like a pretty common use case to me.
- vlovich123 2y agoimpl From<(OldState, Input)> for NewState would be one way.
- michalsustr 2y agoHi, I just made a library which does that! I published first version: https://github.com/michalsustr/rust-automata https://github.com/michalsustr/rust-automata Happy to get feedback.