Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust 编程语言

The Rust Programming Language

由 Steve Klabnik、Carol Nichols 和 Chris Krycho 编写,并得到了 Rust 社区的贡献

by Steve Klabnik, Carol Nichols, and Chris Krycho, with contributions from the Rust Community

本书的这一版本假设你正在使用 Rust 1.90.0(2025-09-18 发布)或更高版本,并在所有项目的 Cargo.toml 文件中设置了 edition = "2024",以配置它们使用 Rust 2024 Edition 惯用法。有关安装或更新 Rust 的说明,请参阅 第 1 章的“安装”部分,有关 Edition 的信息,请参阅 附录 E

This version of the text assumes you’re using Rust 1.90.0 (released 2025-09-18) or later with edition = "2024" in the Cargo.toml file of all projects to configure them to use Rust 2024 Edition idioms. See the “Installation” section of Chapter 1 for instructions on installing or updating Rust, and see Appendix E for information on editions.

HTML 格式可在 https://doc.rust-lang.org/stable/book/ 在线获取,也可通过使用 rustup 安装的 Rust 离线获取;运行 rustup doc --book 即可打开。

The HTML format is available online at https://doc.rust-lang.org/stable/book/ and offline with installations of Rust made with rustup; run rustup doc --book to open.

此外还有多个社区 翻译版本

Several community translations are also available.

本书可从 No Starch Press 购买纸质版和电子书格式

This text is available in paperback and ebook format from No Starch Press.

🚨 想要更具互动性的学习体验吗?尝试一下 Rust Book 的另一个版本,其特色包括:测验、高亮、可视化等等https://rust-book.cs.brown.edu

🚨 Want a more interactive learning experience? Try out a different version of the Rust Book, featuring: quizzes, highlighting, visualizations, and more: https://rust-book.cs.brown.edu