You can't Rust that
The semantics of the final example sounds a lot like the concept of an Atom in clojure - <a href="https://clojure.org/reference/atoms" rel="nofollow">https://clojure.org/reference/atoms</a><p>Is this swap/deref pattern something that can or should be wrapped up into a create?