DE version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
100% Positive
Analyzed from 62 words in the discussion.
Trending Topics
#sure#where#ticket#pdf#types#puzzles#rustacean#pieces#fit#picture

Discussion (3 Comments)Read Original on HackerNews
That's why in crates where I need to make sure certain functions are called in order, I use a Ticket<T>, where one function returns a Ticket<Func1Done> with the output and the other has to consume it as an input.
The typestate pattern is a specialization of making only valid states representable