RustTraining README

The project's README from github.com/microsoft/RustTraining. As one markdown file: README.md.

License This project is dual-licensed under the MIT License and Creative Commons Attribution 4.0 International (CC-BY-4.0).

Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Rust Training Books

Seven training courses covering Rust from different programming backgrounds, plus deep-dives on async, advanced patterns, and engineering practices.

This material combines original content with ideas and examples inspired by some of the best resources in the Rust ecosystem. The goal is to present an in-depth, technically accurate curriculum that weaves together knowledge scattered across books, blogs, conference talks, and video series into a cohesive, pedagogically structured experience.

Disclaimer: These books are training material, not an authoritative reference. While we strive for accuracy, always verify critical details against the official Rust documentation and the Rust Reference.

Inspirations & Acknowledgments

📖 Start Reading

Pick the book that matches your background. Books are grouped by complexity so you can chart a learning path:

Level Description
🟢 Bridge Learn Rust coming from another language — start here
🔵 Deep Dive Focused exploration of a major Rust subsystem
🟡 Advanced Patterns and techniques for experienced Rustaceans
🟣 Expert Cutting-edge type-level and correctness techniques
🟤 Practices Engineering, tooling, and production readiness
Book Level Who it's for
Rust for C/C++ Programmers 🟢 Bridge Move semantics, RAII, FFI, embedded, no_std
Rust for C# Programmers 🟢 Bridge Swift / C# / Java → ownership & type system
Rust for Python Programmers 🟢 Bridge Dynamic → static typing, GIL-free concurrency
Async Rust 🔵 Deep Dive Tokio, streams, cancellation safety
Rust Patterns 🟡 Advanced Pin, allocators, lock-free structures, unsafe
Type-Driven Correctness 🟣 Expert Type-state, phantom types, capability tokens
Rust Engineering Practices 🟤 Practices Build scripts, cross-compilation, CI/CD, Miri

Each book has 15–16 chapters with Mermaid diagrams, editable Rust playgrounds, exercises, and full-text search.

Tip: Browse the rendered books with sidebar navigation and search at the GitHub Pages site.

Local preview: For offline reading or while contributing (install Rust first):

git clone https://github.com/microsoft/RustTraining.git
cd RustTraining
cargo install mdbook mdbook-mermaid
cargo xtask serve    # http://localhost:3000

🔧 For Maintainers

Building, serving, and editing the books locally

Prerequisites

Install Rust via rustup if you haven't already, then:

cargo install [email protected] [email protected]

Clone the repo

git clone https://github.com/microsoft/RustTraining.git
cd RustTraining

Build & serve

cargo xtask build               # Build all books into site/ (local preview)
cargo xtask serve               # Build and serve at http://localhost:3000
cargo xtask deploy              # Build all books into docs/ (for GitHub Pages)
cargo xtask clean               # Remove site/ and docs/

To build or serve a single book:

cd c-cpp-book && mdbook serve --open    # http://localhost:3000

Deployment

The site auto-deploys to GitHub Pages on push to main via .github/workflows/pages.yml. No manual steps needed.

RustTraining (microsoft/RustTraining)

Searching Database…

这是什么东西?微软出品的七本免费 Rust 培训书,带你从其他编程语言入门,一路学到异步、高级模式和工程实践。
它是一整套大课程,还是分开的几本书?是七本独立的书,按难度分层:绿色的 Bridge 层适合从其他语言转学 Rust,蓝色是 Deep Dives(深入探讨),黄色是 Advanced(进阶),紫色是 Expert(专家),棕色是 Practices(实践)。
我该从哪里入手?选一本与你的技术背景相符的书——Bridge 层被标注为起点。带侧边栏导航和搜索功能的排版好的书放在 GitHub Pages 网站上。
我能把这些书当作权威的 Rust 参考手册吗?不能——作者提醒这是培训材料,不是权威参考,关键细节应以官方 Rust 文档和 Rust Reference 为准。
我需要已经会编程吗?你应该已经会用另一门语言编程:Bridge 系列面向 C/C++、C#(以及 Java 或 Swift)和 Python 开发者。没有面向零基础初学者的入门路线。
我能离线阅读吗,还是只能在网页上看?在 GitHub Pages 网站上阅读只需要一个浏览器;如果想离线阅读或参与贡献,可以通过 rustup 安装 Rust、克隆仓库,然后在本地构建或启动单本书。
这些内容是怎么授权的——我能在自己的课程里复用吗?采用 MIT 和 Creative Commons Attribution 4.0(CC-BY-4.0)双重许可,注明出处即可复用;Logo 仍受微软商标准则约束。
每本书里都有什么?每本书有 15-16 章,包含 Mermaid 图表、可编辑的 Rust playground、练习题和全文搜索;在线版还提供侧边栏导航。
过了基础阶段之后,更深层次的书讲些什么?异步 Rust(Tokio、流、取消安全性)、Rust 模式(Pin、内存分配器、无锁数据结构、unsafe)、类型驱动的正确性(type-state、幻影类型、能力令牌),以及工程实践(构建脚本、交叉编译、CI/CD、Miri)。
这些内容是原创的,还是从其他资料汇编而来的?它将原创内容与知名 Rust 资源中的思路和示例相结合——《The Rust Programming Language》、Jon Gjengset 的深度解析视频、Mara Bos 的《Rust Atomics and Locks》、《Rust by Example》等等——并重新组织成一套完整的教学课程。
这个网站会自动更新吗?会——每次向 main 分支推送时,网站都会自动部署到 GitHub Pages,无需任何手动操作;而且这个仓库是全新的,创建于 2026 年 3 月。
Creator
microsoft
Size
1.6 MB
Stars
14.9K
Updated
CommitSep 11
Age
7mo
Commits · 90 Days