Rust 知识复习与校准
#
本文档用于复习知识结构、校准内容准确性、并标记待补充知识点。
最后更新:2025-02
一、知识结构总览
#
当前 0x045-Rust 目录覆盖了 The Rust Book 主线 + 部分进阶与生态,结构如下。
1. 基础 (Fundamentals)
#
| 文档 | 内容概要 |
|---|
| 0x01 Rust overview | 环境、Cargo、生态(CLI/GUI/后端/WASM)、国内源、文档注释 |
| 0x03a Data Types | 标量(整型/浮点/bool/char)、复合(tuple/array)、字面量 |
| 0x03b Functions | 函数定义、语句与表达式、返回值 |
| 0x03c Control Flow | if、loop/while/for |
| 0x05 Struct | 结构体定义、字段、方法、关联函数 |
| 0x06 Enums and Pattern Matching | 枚举变体、match、if let、模式 |
2. 所有权与类型系统 (Core)
#
| 文档 | 内容概要 |
|---|
| 0x04 Ownership | 三规则、move、Copy、drop、函数传参 |
| 0x04 References and Borrowing | 引用、借用规则、可变/不可变、切片、data race |
| 0x10a Generic Types, Traits, and Lifetimes | 泛型 struct/enum/impl、泛型函数 |
| 0x10b Traits | trait 定义与实现、trait bounds、多态 |
| 0x10c Lifetimes | 显式生命周期注解、struct/impl、'static、与泛型组合 |
3. 工程与错误 (Project & Error)
#
| 文档 | 内容概要 |
|---|
| 0x07 Packages, Crates, and Modules | package/crate/mod、路径、use、workspace |
| 0x08a Common Collections | Vec 等 |
| 0x08b String | String 与 str、UTF-8 |
| 0x08c Hash Map | HashMap |
| 0x09 Error Handling | Result/Option、?、unwrap/expect、main 返回 Result |
4. 进阶 (Advanced)
#
| 文档 | 内容概要 |
|---|
| 0x11 Automated Tests | 测试(未在本次逐字审阅) |
| 0x13a Iterators and Closures | 闭包、捕获、Fn/FnMut/FnOnce、move |
| 0x13b Iterators | 惰性、iter/into_iter/iter_mut、map/filter/collect/sum |
| 0x15 Smart Pointers | Box、Deref、Drop、Rc、RefCell、内部可变性 |
| 0x16 Concurrency | 线程、JoinHandle、move、mpsc、Mutex、Arc |
| 0x10c Lifetimes | 见上 |
| Macros | 声明宏 vs 过程宏(简述) |
| Unsafe Rust | 五类 unsafe 操作列举 |
5. 生态与工具 (Overview 中)
#
- CLI:clap、structopt、termion、serde 等
- GUI:Tauri、Iced、Dioxus、Slint、egui 等
- 后端:Rocket、Actix、Axum、Pingora 等
- WASM:wasm-bindgen、wasm-pack
二、校准项(已修正与建议)
#
已修正
#
0x01-Rust overview.md
...