HATRA Demo
Fig. 1
- Every resource has a unique owner.
- Ownership can be moved.
- A resource is dropped (i.e. deallocated) when its owner dies.
Fig. 2
- Borrowing (i.e. taking a reference) allows use of a resource without changing the owner.
- Mutation is allowed through mutable borrows but not through immutable borrows.
- There can be multiple immutable borrows live.
- If a mutable borrow is live, no other borrow can be live.