How to use this topic

The first five pages cover the basics: what Rust is, installing it and using Cargo, types and mutability, control flow and pattern matching, and functions, modules and crates. Pages 6 to 8 explain what makes Rust different — ownership, borrowing and lifetimes — and are best read in order. Pages 9 to 15 build on them: structs and enums, error handling, collections and strings, traits and generics, iterators and closures, smart pointers and concurrency. The last three cover the work around the code: testing and tooling, the crate ecosystem and supply-chain safety, and unsafe Rust and calling C.

General ideas such as the stack, the heap and reference counting are introduced in Programming Concepts: memory management, which also gives a short overview of ownership in Rust; this topic goes deeper. Readers coming from C will find the memory bugs that Rust rules out explained in the C topic, especially undefined behavior and safer C. If you work with microcontrollers, the firmware page in IoT & Embedded Systems shows where Rust fits next to C on small devices, and supply-chain attacks are covered in Security.

Every runnable Rust example is a complete program compiled with the 2024 edition and all warnings turned into errors, and shows its exact output; Cargo examples run without network access, and output from tools that are not installed here is labeled illustrative. Recorded output comes from a 64-bit Linux machine (ARM64).

There is no certification tag on this topic: as of October 2026 there is no widely recognized exam for individual Rust developers.

Learning path

  1. 01What Is Rust?What Rust is and why it matters: memory safety without a garbage collector, its path from Mozilla research project to Rust 1.0 and the Rust Foundation, editions and the six-week release train, and where Rust runs today.Beginner
  2. 02Installing Rust and Using CargoInstalling the toolchain with rustup, compiling a first program with rustc, and working with Cargo: new projects, Cargo.toml, build, run and check, and the difference between debug and release builds.Beginner
  3. 03Variables, Types and Mutabilitylet bindings that are immutable by default, mut and shadowing, Rust's integer, float, bool and char types, integer overflow that panics in debug builds, safe conversions instead of silent casts, and money as integers.Beginner
  4. 04Control Flow and Pattern Matchingif as an expression, loop, while and for, and the match expression that the compiler checks for every possible case — with patterns, guards, if let, let-else and let chains.Beginner
  5. 05Functions, Modules and CratesFunctions with typed parameters and tail expressions, modules and privacy, use paths, and how packages and crates organize a Rust program across files and libraries.Beginner
  6. 06OwnershipThe rules at the heart of Rust: every value has one owner, assignment moves it, Copy types are copied, and values are dropped at the end of their scope — which rules out use-after-free and double free without a garbage collector.Intermediate
  7. 07Borrowing and ReferencesUsing a value without taking it: shared and mutable references, the rule of many readers or one writer, how the borrow checker enforces it, and why Rust has no dangling references.Intermediate
  8. 08LifetimesHow Rust knows a reference stays valid: lifetime annotations that describe relationships between references, the elision rules that make most of them unnecessary, structs that hold references, and 'static.Advanced
  9. 09Structs, Enums and MethodsGrouping data in structs, modeling choices with enums that carry data, adding methods and associated functions in impl blocks, and deriving common behavior such as Debug and PartialEq.Beginner
  10. 10Error HandlingErrors as values: Option for a missing value, Result for an operation that can fail, the ? operator to pass errors up, panics for bugs, and when unwrap and expect are acceptable.Intermediate
  11. 11Collections and StringsVec, HashMap, BTreeMap and sets from the standard library, why HashMap order changes from run to run, and Rust's UTF-8 strings: String versus &str, bytes versus characters, and safe slicing.Beginner
  12. 12Traits and GenericsShared behavior with traits, generic functions and types with trait bounds, static dispatch by monomorphization versus trait objects with dyn, derive, and the standard traits every type meets.Intermediate
  13. 13Iterators and ClosuresThe Iterator trait, lazy adapters such as map and filter, consumers such as sum and collect, and closures that capture their environment by reference, by mutable reference or by value.Intermediate
  14. 14Smart PointersBox for data on the heap, Rc and Arc for shared ownership through reference counting, Weak to break cycles, and RefCell and Cell for interior mutability checked at run time.Advanced
  15. 15ConcurrencyThreads, move closures and scoped threads, sharing state with Arc and Mutex, passing messages over channels, how the Send and Sync traits rule out data races at compile time, and a first look at async.Advanced
  16. 16Testing, Docs and ToolingUnit tests, integration tests and doc tests with cargo test, documentation comments and cargo doc, and the tools that keep Rust code tidy: Clippy for lints and rustfmt for formatting.Intermediate
  17. 17The Crate Ecosystem and Supply-Chain Safetycrates.io and how Cargo picks dependency versions, Cargo.lock, yanked versions, build scripts that run code at build time, and how to keep third-party crates safe with advisories, audits and review.Intermediate
  18. 18Unsafe Rust and Calling CWhat unsafe allows and what it does not switch off, raw pointers, wrapping unsafe code in a safe interface, calling a C library through the foreign function interface, and tools such as Miri that check unsafe code.Advanced

Rust glossary

Short definitions of the terms used in this topic. The full glossary covers every topic.