Memory and ownership
Explore ownership, borrowing, and assignment, starting with the stack and the heap.
- Chapter 1 · From automatic reclamation to ownership6 sections available
- Chapter 2 · Variables and assignment3 sections available
Understand the principles behind Rust's design
Rust Root is an open guide to Rust. Starting with concrete problems, we combine reasoning and code experiments to understand Rust's rules and their limits.
Familiarity with a programming language is recommended. No prior Rust experience is required.
Reading path
The guide is planned in five parts. Start with the first part, then use its rules to explore types, abstraction, sharing, and system boundaries.
Explore ownership, borrowing, and assignment, starting with the stack and the heap.
Understand type representation and constraints, and how types combine to organize data.
Express shared behavior with generics, traits, iterators, and closures.
Understand shared ownership, interior mutability, and thread safety.
Explore advanced lifetimes, unsafe Rust, and asynchronous programming.
How to read
Start with a concrete problem to understand what a rule addresses, then check your reasoning through code experiments and compiler feedback. Later sections apply these judgments to type design, code organization, and engineering problems.
The appendix covers basic syntax, mechanisms, and comparisons with other languages. It is currently available in Chinese.
jimichen writes Rust Root, drawing on questions encountered while moving from object-oriented and dynamic languages to Rust.
Sections are published in Chinese and translated into English as they stabilize. Published content may change; to report an issue, send an email with the page URL and relevant passage.