2 ms·
What I mean is that if preserving invariants across function calls is important enough that an async call can break it, you want the invariant to be enforced st
by gpderetta 3y ago
What I mean is that if preserving invariants across function calls is important enough that an async call can break it, you want the invariant to be enforced statically by the compiler and you do not want to rely on visual inspection of the source to confirm lack of reentrancy.
Once you do that, you do not need a call site annotation that a function can be preempted as the compiler will check it for you.
Rust is uniquely equipped to enforce these guarantees.