Guide · Open source
How to use RustTraining: clone, build and read the books
Updated · written with AI from the project's own documentation and checked against our catalogue data
RustTraining is a Microsoft open-source collection of seven Rust training books, ranging from bridge courses for people coming from C/C++, C#, or Python to deep dives on async Rust, advanced patterns, type-driven correctness, and engineering practices. This guide explains which book to start with, how to read them on the website or offline, and how to build them locally. By the end you will know how to pick a path, get the books running on your machine, and what the material is and is not good for.
Quick start
- 1Install Rust. Install Rust with rustup from rustup.rs. This is the only prerequisite named in the README.
- 2Clone the repository. Run git clone on the microsoft/RustTraining repository and move into the RustTraining folder.
- 3Install mdbook tools. Run cargo install mdbook mdbook-mermaid to get the book builder and the Mermaid diagram preprocessor.
- 4Serve the books. Run cargo xtask serve and open http://localhost:3000 in your browser.
- 5Pick a book and read. Start with a Bridge book if you know C/C++, C#, or Python, then move to Async, Patterns, Type-Driven Correctness, or Engineering Practices.
Choose the right book for your background
The books are grouped by level. If you already program in another language, start with one of the three Bridge books, which assume experience elsewhere. Each book covers a different area, so you can follow a learning path from there.
- Bridge (start here): Rust for C/C++ Programmers, Rust for C# Programmers, Rust for Python Programmers
- Deep Dive: Async Rust, covering Tokio, streams, and cancellation safety
- Advanced: Rust Patterns, covering Pin, allocators, lock-free structures, and unsafe
- Expert: Type-Driven Correctness, covering type-state, phantom types, and capability tokens
- Practices: Rust Engineering Practices, covering build scripts, cross-compilation, CI/CD, and Miri
Read the books on the GitHub Pages site
The simplest way to start is the rendered website on GitHub Pages. Each book has sidebar navigation and full-text search. Each book has 15–16 chapters with Mermaid diagrams, editable Rust playgrounds, and exercises.
Install Rust and clone the repository for offline reading
To read offline or contribute, install Rust first using rustup from rustup.rs. Then clone the repository and move into the project folder.
git clone https://github.com/microsoft/RustTraining.git
cd RustTrainingInstall mdbook and mdbook-mermaid
The books are built with mdbook and the mdbook-mermaid preprocessor. Install both with Cargo, Rust's package manager.
cargo install mdbook mdbook-mermaidServe the books locally
Run the xtask command from the project folder. The README says the books are served at http://localhost:3000, so open that address in your browser after the command starts.
- cargo xtask build builds all books into site/ for local preview
- cargo xtask serve builds and serves them at http://localhost:3000
- cargo xtask deploy builds all books into docs/ for GitHub Pages
- cargo xtask clean removes site/ and docs/
- To serve a single book, cd into its folder (for example c-cpp-book) and run mdbook serve --open
cargo xtask serveKnow what the material is not
The project describes these books as training material, not an authoritative reference. The authors say they strive for accuracy, but the README tells readers to verify critical details against the official Rust documentation and the Rust Reference. The content is also a blend of original material and ideas drawn from many community resources.
- Use the official Rust docs and the Rust Reference to check critical details
- Expect a training path, not a complete or guaranteed-accurate course
- Do not start here if you have no programming background
What people use it for
- Moving from C/C++ to Rust, using the bridge book on move semantics, RAII, and FFI
- Learning Rust's ownership model as a C# or Python developer
- Studying async Rust with Tokio, streams, and cancellation safety
- Reading about build scripts, cross-compilation, and CI/CD for a Rust project
- Reading the books offline after cloning and building them locally
Frequently asked questions
Is RustTraining free?
The project is dual-licensed under the MIT License for code and Creative Commons Attribution 4.0 International (CC-BY-4.0) for documentation. You can read the books on the GitHub Pages site without installing anything.
What do I need to install RustTraining?
The README lists Rust, installed with rustup, as the prerequisite. You then clone the repository and install mdbook and mdbook-mermaid with cargo install if you want to build the books locally.
How do I run RustTraining on my own computer?
Clone the repository, move into the RustTraining folder, install mdbook and mdbook-mermaid, and run cargo xtask serve. The books are then served at http://localhost:3000.
Is RustTraining accurate enough to replace the official Rust docs?
No. The project says it is training material, not an authoritative reference. The README tells readers to verify critical details against the official Rust documentation and the Rust Reference.
Which book should a complete beginner read first?
The README says the bridge books assume experience in another language, so complete beginners with no programming background are not the target audience. If you have programmed in C/C++, C#, or Python, start with the matching bridge book.
How does RustTraining compare to The Rust Programming Language or Rustlings?
The Rust Programming Language is the official book and is the foundation RustTraining builds on. Rustlings and Rust by Example are other learning resources in the same space, and RustTraining focuses on bridge courses from other languages plus advanced topics such as async, patterns, and engineering practices.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
RustTraining suits experienced C, C++, C#, or Python developers learning Rust, and engineers who want async, advanced pattern, or build and CI/CD material. It is a poor fit if you need an authoritative reference, a guaranteed-accurate course, or a first programming course. Pair it with the official Rust documentation for anything critical.
Install options & downloads