Version: 1.1.0
Ownership cheat sheet
Who owns a value, and how it is allowed to move.
Essentials
readborrows without changing the value.mutborrows and can assign to fields.ownedtakes the value. Callers pass it with^.- The last use destroys an owned value.
- A returned value transfers ownership to the caller.
Example
fn take(owned s: String):
print(s)
fn main():
var s = String("x")
take(s^)
Keep in mind
After ^, the source name is empty. Using it is a compile error.