3 ms·
State-shift: Macros for implementing Type-State-Pattern on your structs and met
- sureglymop 2y agoReadme is also a nice way to understand the Type state pattern. Well done! What about transitions to the same state that mutate? E.g. for a type state builder pattern. Let's say you have a "Jar" and want to "fill()" it over and over before "seal()"-ing it which is when the state change would happen? Would that be considered no longer a type state pattern? Would all the fill states need to be encoded as types?