Parcours d'apprentissage

Ownership et emprunt

Déplacements, références, slices, durées de vie et pointeurs intelligents : les idées qui rendent Rust sûr en mémoire sans ramasse-miettes.

5 leçons · 7 défis

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