課程架構
本頁面的適用對象為課程講師。
Rust 基礎知識
我們會在前三天介紹 Rust 基礎知識。這幾天的步調會稍快,因為要探討許多層面:
- 第 1 天:Rust 基本概念、語法、控制流程、建立及取用值。
- Day 2: Memory management, ownership, compound data types, and the standard library.
- Day 3: Generics, traits, error handling, testing, and unsafe Rust.
深入探索
除了為期 3 天的 Rust 基礎知識課程,我們也涵蓋更多專門主題:
Rust in Android
The Rust in Android deep dive is a half-day course on using Rust for Android platform development. This includes interoperability with C, C++, and Java.
您會需要進行 Android 開放原始碼計畫檢查。請檢查課程存放區上相同的機器,並將 src/android/
目錄移至 Android 開放原始碼計畫檢查的根層級。這可確保 Android 建構系統在 src/android/
中看到 Android.bp
檔案。
請確保 adb sync
可與模擬器或實際裝置搭配使用,並運用 src/android/build_all.sh
預先建構所有 Android 範例。請閱讀指令碼,瞭解指令碼執行的指令,並確保可以手動執行指令。
Bare-Metal Rust
The Bare-Metal Rust deep dive is a full day class on using Rust for bare-metal (embedded) development. Both microcontrollers and application processors are covered.
針對微控制器,您會需要預先購買 BBC micro:bit 第 2 版開發板。此外,所有人都需要按照歡迎頁面上的指示安裝多種套件。
Concurrency in Rust
The Concurrency in Rust deep dive is a full day class on classical as well as async
/await
concurrency.
您會需要設定新的 Crate,然後下載並準備執行依附元件。接著就能將範例複製貼上至 src/main.rs
,使用這些範例進行實驗:
cargo init concurrency
cd concurrency
cargo add tokio --features full
cargo run
形式
本課程極具互動性,因此建議您根據各項疑問,帶領學員瞭解 Rust!