You can't Rust that
The semantics of the final example sounds a lot like the concept of an Atom in clojure - https://clojure.org/reference/atomsIs this swap/deref pattern something that can or should be wrapped up into a create?