Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

ownership

Which variable is responsible for a value and cleaning it up.

Every value has exactly one owner; when the owner goes out of scope the value is dropped.

Loading interactive…

Examples

  • let city = String::from("Oslo"); makes city the owner of the heap text, which is freed at the closing brace of the block city lives in.

Read the full section →