Lernpfad

Ownership und Borrowing

Moves, Referenzen, Slices, Lifetimes und Smart Pointer: die Ideen, die Rust ohne Garbage Collector speichersicher machen.

5 Lektionen · 7 Challenges

  1. Lektion 1 Challenge Ownership and Moves Learn the rule behind Rust's memory safety: every value has one owner.
  2. Lektion 2 Challenges References and Borrowing Let a function use a value without taking ownership of it.
  3. Lektion 2 Challenges Slices Borrow part of a string or array without copying it.
  4. Lektion 1 Challenge Lifetimes Tell the compiler how long references stay valid with lifetime annotations.
  5. Lektion 1 Challenge Smart Pointers: Box and Rc Put data on the heap with Box and share ownership with Rc.