by GolDDranks · 10y ago · 0 comments
I think it's especially the linear types (or "affine", which is the Rust's variety of almost-linear types) that allows for this kind of statically-checked state machines.
Using Unique Ptr it's a bit hard IIRC (it's been 2 years since I've written C++) but still possible.