Name of a pattern?

I cannot find an article I was reading recently describing capability of rust to implement certain functionality of a type depending on a state of that type. As an example, there was a file example described how there is a open method implemented on a file that is unopen, but there isn't such method (an open method) on a closed file?
Does anyone know what I'm talking about?

Are you looking for typestate pattern?



This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.