Advanced Vocabulary #rust #ownership #borrow-checker #memory-safety

Rust Vocabulary

5 exercises — ownership and move semantics, Result vs panic!, Rc vs Arc smart pointers, traits with default implementations, and the borrow checker trade-off in professional English.

0 / 5 completed
Rust-specific English vocabulary reference
  • ownership — every value has one owner; when owner goes out of scope, value is dropped
  • borrow / &T — temporary read access; mutable borrow / &mut T — temporary exclusive write access
  • lifetime — compiler-tracked duration of a reference's validity
  • Result<T, E> — recoverable errors; panic! — unrecoverable program errors
  • trait — shared behaviour interface; can have default method implementations
  • Arc<Mutex<T>> — thread-safe shared mutable state; Rc<RefCell<T>> — single-thread only
1 / 5
A Rust code review comment says: "This function takes ownership of the String — you should borrow it instead." What does "taking ownership" mean in Rust?