欢迎来到 Comprehensive Rust 🦀
这是由 Android 团队开发的免费 Rust 课程。该课程涵盖了 Rust 的全部范围,从基本语法到高级主题如泛型和错误处理。
如需查看课程的最新版本,请访问 https://google.github.io/comprehensive-rust/。如果您是在其他地方阅读,请查看这个网址了解是否有更新。
本课程的目标是教授你 Rust。我们假设你对 Rust 一无所知,并希望能够:
- 帮助你全面理解 Rust 的语法和语言。
- 使你能够修改现有的程序并用 Rust 编写新程序。
- 展示常见的 Rust 习语。
我们将前三天的课程称为Rust 基础知识
。
在此基础上,你可以选择深入学习一个或多个专门的主题:
- Android:一个半天的课程,介绍如何在 Android 平台开发中使用 Rust(AOSP)。课程内容包括与 C、C++ 和 Java 的互操作性。
- Bare-metal:为期一天的课程,介绍如何使用 Rust 进行裸机(嵌入式)开发。课程内容涵盖微控制器和应用处理器。
- Concurrency: a whole-day class on concurrency in Rust. We cover both classical concurrency (preemptively scheduling using threads and mutexes) and async/await concurrency (cooperative multitasking using futures).
非目标
Rust 是一门庞大的语言,我们无法在几天内涵盖所有内容。本课程的一些非目标包括:
- Learning how to develop macros: please see Chapter 19.5 in the Rust Book and Rust by Example instead.
前提假设
The course assumes that you already know how to program. Rust is a statically-typed language and we will sometimes make comparisons with C and C++ to better explain or contrast the Rust approach.
If you know how to program in a dynamically-typed language such as Python or JavaScript, then you will be able to follow along just fine too.
This is an example of a speaker note. We will use these to add additional information to the slides. This could be key points which the instructor should cover as well as answers to typical questions which come up in class.