Percorso di apprendimento

Ownership e borrowing

Move, riferimenti, slice, lifetime e smart pointer: le idee che rendono Rust sicuro in memoria senza garbage collector.

5 lezioni · 7 sfide

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