Comment by J_Shelby_J
4 hours ago
Like set an generic marker struct IsEncrypted<T> where T is yes or now and only allow its state to change when proven and then write the shutdown function to only take the yes variant?
4 hours ago
Like set an generic marker struct IsEncrypted<T> where T is yes or now and only allow its state to change when proven and then write the shutdown function to only take the yes variant?
Yes, that would be one way of doing it. You can model off of the Typed Builder pattern:
This won't work for everything, but it is a pattern that I find useful to ensure that things can't happen out of order.