通过例子学 Rust

Rust By Example(通过例子学 Rust)

译文 · 基于 Rust By Example

原文链接: https://doc.rust-lang.org/stable/rust-by-example/index.html

通过例子学 Rust

一套可运行的示例,讲解 Rust 语言特性与标准库。

源码仓库:https://github.com/rust-lang/rust-by-example

在线阅读:https://doc.rust-lang.org/stable/rust-by-example/

章节导航


介绍

介绍 — Rust By Example

第1章 Hello World

Hello World — Rust By Example

第2章 原生类型

原生类型 — Rust By Example

第3章 自定义类型

自定义类型 — Rust By Example

第4章 变量绑定

变量绑定 — Rust By Example

第5章 类型系统

类型系统 — Rust By Example

第6章 类型转换

类型转换 — Rust By Example

第7章 表达式

表达式 — Rust By Example

第8章 流程控制

流程控制 — Rust By Example

第9章 函数

函数 — Rust By Example

第10章 模块

模块 — Rust By Example

第11章 crate

crate — Rust By Example

第12章 cargo

cargo — Rust By Example

第13章 属性

属性 — Rust By Example

第14章 泛型

泛型 — Rust By Example

第15章 作用域规则

作用域规则 — Rust By Example

第16章 特质 trait

特质 trait — Rust By Example

第17章 使用 `macro_rules!` 来创建宏

使用 macro_rules! 来创建宏 — Rust By Example

第18章 错误处理

错误处理 — Rust By Example

第19章 标准库类型

标准库类型 — Rust By Example

第20章 标准库更多介绍

标准库更多介绍 — Rust By Example

第21章 测试

测试 — Rust By Example

第22章 不安全操作

不安全操作 — Rust By Example

第23章 兼容性

兼容性 — Rust By Example

第24章 补充

补充 — Rust By Example

最后修改 August 21, 2026: 更新 (76fc81a2e)