“Ownership is the responsibility of some piece of code to eventually cause a value to be destroyed. An ownership system is a set of rules or conventions for managing and transferring ownership.”
Modifier | Caller | Callee |
borrowing | Remains owner of original value. No need to copy or retain value. Responsible for keeping it alive for the duration of the callee. | No need for a release. No implicit copying allowed. Explicit copying is required with a copy operator. |
consuming | It can either give ownership of the original value to the callee OR retain or copy the value if it requires ownership of its own value. | Required to release the value. |