Comment on Functional State Machines in Rust: Typestate and Newtype PatternsparentComments−vatsachak12dThat's fair, but you would have to make sure that write_buffer is the only function that can create a WrittenBuffer<'a>. And then the second function could take a WrittenBuffer<'a> as an unused argI mean there's many ways to skin a cat!
Comments
That's fair, but you would have to make sure that write_buffer is the only function that can create a WrittenBuffer<'a>. And then the second function could take a WrittenBuffer<'a> as an unused arg
I mean there's many ways to skin a cat!