Docs / Language
Memory
An owning value has one owner. Pass/return/store by value moves. Drop is deterministic at end of scope. Use-after-move is a compile error.
| Form | Meaning |
|---|---|
by-value string / []T | move |
&x | shared borrow |
mut &x (x must be mut) | exclusive borrow |
*r | deref a scalar (writes need &mut) |
While a shared borrow is live you cannot write / move / take &mut. There is no unsafe keyword. Hosted targets reject volatile stores to arbitrary addresses.
File and Conn are affine resources: moves transfer ownership and scope exit closes them. Their native handles are package-private. Borrow the resource for I/O and observe explicit EOF/error data and write-progress results when using the progress APIs.