In Rust, Result objects are usually consumed by certain methods. That behavior should be simulated by adding a consumed field of type bool. If that flag is set, an Error will be thrown (cannot use consumed objects). Also, the API will create new objects instead of modifying the current one.
Imho, this could be done with a wrapper. That would allow safe development and performance in production (given TDD and unit tests are performed)
In Rust, Result objects are usually consumed by certain methods. That behavior should be simulated by adding a
consumedfield of type bool. If that flag is set, an Error will be thrown (cannot use consumed objects). Also, the API will create new objects instead of modifying the current one.Imho, this could be done with a wrapper. That would allow safe development and performance in production (given TDD and unit tests are performed)