From 80acbb0de77fc7da0155e60406cf294ec1255ab8 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:47:31 +0000 Subject: [PATCH 01/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0async=E5=92=8Cawait?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appendix/keywords.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/appendix/keywords.md b/src/appendix/keywords.md index 70f330105..d1c815d32 100644 --- a/src/appendix/keywords.md +++ b/src/appendix/keywords.md @@ -7,6 +7,8 @@ 如下关键字目前有对应其描述的功能。 - `as` - 强制类型转换,或`use` 和 `extern crate`包和模块引入语句中的重命名 +- `async` - 返回一个 Future 而不是阻塞当前线程 +- `await` - 暂停执行直到 Future 的结果就绪 - `break` - 立刻退出循环 - `const` - 定义常量或原生常量指针(constant raw pointer) - `continue` - 继续进入下一次循环迭代 @@ -48,8 +50,6 @@ 如下关键字没有任何功能,不过由 Rust 保留以备将来的应用。 - `abstract` -- `async` -- `await` - `become` - `box` - `do` From 6a7dadb7612173cd88384b6806e98854c3d0bedd Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:23:15 +0000 Subject: [PATCH 02/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0SelfTy=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appendix/keywords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appendix/keywords.md b/src/appendix/keywords.md index d1c815d32..cf5be6d01 100644 --- a/src/appendix/keywords.md +++ b/src/appendix/keywords.md @@ -5,7 +5,7 @@ ### 目前正在使用的关键字 如下关键字目前有对应其描述的功能。 - +- `SelfTy` - 'trait' 或 'impl' 块中的实现类型,或类型定义中的当前类型。 - `as` - 强制类型转换,或`use` 和 `extern crate`包和模块引入语句中的重命名 - `async` - 返回一个 Future 而不是阻塞当前线程 - `await` - 暂停执行直到 Future 的结果就绪 From a0c941edb3fdb11d19b71d03e1b7c1f956d0da94 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:28:40 +0000 Subject: [PATCH 03/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0union=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appendix/keywords.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/appendix/keywords.md b/src/appendix/keywords.md index cf5be6d01..b211ddad4 100644 --- a/src/appendix/keywords.md +++ b/src/appendix/keywords.md @@ -40,6 +40,7 @@ - `trait` - 定义一个特征 - `true` - 布尔值 `true` - `type` - 定义一个类型别名或关联类型 +- `union` - Rust 等价于 c 风格的 union - `unsafe` - 表示不安全的代码、函数、特征或实现 - `use` - 在当前代码范围内(模块或者花括号对)引入外部的包、模块等 - `where` - 表示一个约束类型的从句 From ce86dcdc827bcd407a19bb10944217ccb0bef0d4 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:29:12 +0000 Subject: [PATCH 04/11] Update keywords.md --- src/appendix/keywords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appendix/keywords.md b/src/appendix/keywords.md index b211ddad4..613fef519 100644 --- a/src/appendix/keywords.md +++ b/src/appendix/keywords.md @@ -5,7 +5,7 @@ ### 目前正在使用的关键字 如下关键字目前有对应其描述的功能。 -- `SelfTy` - 'trait' 或 'impl' 块中的实现类型,或类型定义中的当前类型。 +- `SelfTy` - `trait` 或 `impl` 块中的实现类型,或类型定义中的当前类型。 - `as` - 强制类型转换,或`use` 和 `extern crate`包和模块引入语句中的重命名 - `async` - 返回一个 Future 而不是阻塞当前线程 - `await` - 暂停执行直到 Future 的结果就绪 From 0d1cc2382a023290ebba54f284c31571d8804d78 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:04:36 +0000 Subject: [PATCH 05/11] Create primitive-types.md --- src/appendix/primitive-types.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/appendix/primitive-types.md diff --git a/src/appendix/primitive-types.md b/src/appendix/primitive-types.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/appendix/primitive-types.md @@ -0,0 +1 @@ + From 7de67cec19e471bd1ffdad0ef4563241c342d055 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:06:59 +0000 Subject: [PATCH 06/11] Update primitive-types.md --- src/appendix/primitive-types.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/appendix/primitive-types.md b/src/appendix/primitive-types.md index 8b1378917..86938108a 100644 --- a/src/appendix/primitive-types.md +++ b/src/appendix/primitive-types.md @@ -1 +1,17 @@ +## 附录 A:原始类型 +下面的列表包含 Rust 中的原始类型 +### 原始类型 +- `never` - `!`类型,也称为"never" +- `array` - 一个固定大小的数组,表示为`[T;N]`,用于元素类型`T`和非负编译时常量大小`N` +- `bool` - 布尔类型- +- `char` - 一个字符类型 +- `f32` - 32 位浮点类型 (特别是 IEEE 754-2008 中定义的"binary32"类型) +- `f64` - 64 位浮点类型 (特别是 IEEE 754-2008 中定义的"binary64"类型) +- `fn` - 函数指针,例如`fn(usize) -> bool` +- `i8` - 8位带符号整数类型 +- `i16` -16位带符号整数类型 +- `i32` -32位带符号整数类型 +- `i64` -64位带符号整数类型 +- `i128` -128位带符号整数类型 +- `isize `-指针大小的有符号整数类型 From f3d7abeaa08de88d5f2ab4d6da4552328b747c3e Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:10:37 +0000 Subject: [PATCH 07/11] Update primitive-types.md --- src/appendix/primitive-types.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/appendix/primitive-types.md b/src/appendix/primitive-types.md index 86938108a..2102e7922 100644 --- a/src/appendix/primitive-types.md +++ b/src/appendix/primitive-types.md @@ -13,5 +13,16 @@ - `i32` -32位带符号整数类型 - `i64` -64位带符号整数类型 - `i128` -128位带符号整数类型 -- `isize `-指针大小的有符号整数类型 - +- `isize` -指针大小的有符号整数类型 +- `pointer` -原始的,不安全的指针`*const T`和`*mut T` +- `reference` -引用 `&T`和`&mut T` +- `slice` - 一个动态大小的视图到一个连续的序列 [T] 这里的连续意味着元素的布局应使每个元素与其相邻元素之间的距离相同 +- `str` - 字符串切片 +- `tuple` - 元组 一个有限异构序列 `(T,U,..)` +- `u8` - 8位无符号整数类型 +- `u16` -16位无符号整数类型 +- `u32` -32位无符号整数类型 +- `u64` -64位无符号整数类型 +- `u128` -128位无符号整数类型 +- `unit` - `()`类型 +- `usize` - 指针大小的无符号整数类型 From 332857c72ca2f2c0e411ad7f535d42d6833a76de Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:11:36 +0000 Subject: [PATCH 08/11] Update SUMMARY.md --- src/SUMMARY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index ce1e50526..ac86e71b0 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -355,6 +355,7 @@ - [Appendix]() - [关键字](appendix/keywords.md) + - [原始类型](appendix/primitive-types.md) - [运算符与符号](appendix/operators.md) - [表达式](appendix/expressions.md) - [派生特征 trait](appendix/derive.md) From 790d9c8425e88116b1d99613355776e796ed7d70 Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:13:28 +0000 Subject: [PATCH 09/11] Update SUMMARY.md --- src/SUMMARY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index ac86e71b0..04da035e9 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -355,7 +355,7 @@ - [Appendix]() - [关键字](appendix/keywords.md) - - [原始类型](appendix/primitive-types.md) + - [运算符与符号](appendix/operators.md) - [表达式](appendix/expressions.md) - [派生特征 trait](appendix/derive.md) @@ -379,3 +379,4 @@ - [1.72](appendix/rust-versions/1.72.md) - [1.73](appendix/rust-versions/1.73.md) - [1.74](appendix/rust-versions/1.74.md) +- [原始类型](appendix/primitive-types.md) From 751f681cca099e46e289d6843ebbee0c6dfd763e Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:13:56 +0000 Subject: [PATCH 10/11] Update SUMMARY.md --- src/SUMMARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 04da035e9..a42f178f4 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -379,4 +379,4 @@ - [1.72](appendix/rust-versions/1.72.md) - [1.73](appendix/rust-versions/1.73.md) - [1.74](appendix/rust-versions/1.74.md) -- [原始类型](appendix/primitive-types.md) + - [原始类型](appendix/primitive-types.md) From 7491cdcfaecfceca0208179a88b156315992f04f Mon Sep 17 00:00:00 2001 From: donjuanplatinum <113148619+donjuanplatinum@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:14:45 +0000 Subject: [PATCH 11/11] Update primitive-types.md --- src/appendix/primitive-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appendix/primitive-types.md b/src/appendix/primitive-types.md index 2102e7922..da467546c 100644 --- a/src/appendix/primitive-types.md +++ b/src/appendix/primitive-types.md @@ -1,4 +1,4 @@ -## 附录 A:原始类型 +## 附录 H:原始类型 下面的列表包含 Rust 中的原始类型 ### 原始类型 - `never` - `!`类型,也称为"never"