feat: add rust.md
cheatsheet (#20).
This commit is contained in:
parent
c7df917009
commit
e66c1c57fd
@ -38,6 +38,7 @@ Quick Reference
|
||||
[Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));-->
|
||||
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));&class=tag&data-lang=SQL-->
|
||||
[Python](./docs/python.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));-->
|
||||
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));-->
|
||||
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));-->
|
||||
[SwiftUI](./docs/swiftui.md)<!--rehype:style=background: rgb(10 127 247/var(\-\-bg\-opacity));&class=tag&data-lang=swift-->
|
||||
[TOML](./docs/toml.md)<!--rehype:style=background: rgb(132 132 132/var(\-\-bg\-opacity));-->
|
||||
|
735
docs/rust.md
Normal file
735
docs/rust.md
Normal file
@ -0,0 +1,735 @@
|
||||
Rust 备忘清单
|
||||
====
|
||||
|
||||
Rust 快速参考备忘单,旨在为编写基本语法和方法提供帮助。
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### Hello_World.rs
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
println!("Hello, World!");
|
||||
}
|
||||
```
|
||||
#### 编译运行
|
||||
|
||||
```shell
|
||||
$ rustc Hello_World.rs
|
||||
$ ./Hello_World
|
||||
Hello, World!
|
||||
```
|
||||
|
||||
### 原始类型
|
||||
|
||||
:-| :-
|
||||
:-| :-
|
||||
`bool` | 布尔值 (`true` _/_ `false`)
|
||||
`char` | 字符
|
||||
`f32`, `f64` | 32 位、64 位浮点数
|
||||
`i64`, `i32`, `i16`, `i8` | 有符号 16- ... 整数
|
||||
`u64`, `u32`, `u16`, `u8` | 无符号 16 位,... 整数
|
||||
`isize` | 指针大小的有符号整数
|
||||
`usize` | 指针大小的无符号整数
|
||||
|
||||
查看: [Rust 类型](#rust-类型)
|
||||
|
||||
### Formatting
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```rust {.wrap}
|
||||
// 单个占位符
|
||||
println!("{}", 1);
|
||||
// 多个占位符
|
||||
println!("{} {}", 1, 3);
|
||||
// 位置参数
|
||||
println!("{0} 是 {1} {2},{0} 也是 {3} 编程语言", "Rust", "cool", "language", "safe");
|
||||
// 命名参数
|
||||
println!("{country} 是一个团结的国家", country = "China");
|
||||
// 占位符特征 :b 表示二进制, :0x 表示十六进制, :o 表示八进制
|
||||
println!("让我们打印 76 是二进制的 {:b} ,十六进制等价物是 {:0x} 八进制等价物是 {:o}", 76, 76, 76);
|
||||
// 调试特征
|
||||
println!("使用调试特征 {:?} 在此处打印我们想要的任何内容", (76, 'A', 90));
|
||||
|
||||
// 1.58 中的新格式字符串
|
||||
let x = "world";
|
||||
println!("Hello {x}!");
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
### 打印风格
|
||||
|
||||
```rust
|
||||
// 打印输出
|
||||
print!("Hello World\n");
|
||||
// 打印后追加新行
|
||||
println!("追加新行");
|
||||
// 打印为错误
|
||||
eprint!("这是一个错误\n");
|
||||
// 打印为新行错误
|
||||
eprintln!("这是新行的错误");
|
||||
```
|
||||
|
||||
### 变量
|
||||
|
||||
```rust
|
||||
// 初始化和声明变量
|
||||
let some_variable = "This_is_a_variable";
|
||||
// 使变量可变
|
||||
let mut mutable_variable = "Mutable";
|
||||
// 分配多个变量
|
||||
let (name, age) = ("ElementalX", 20);
|
||||
// (全局)常量
|
||||
const SCREAMING_SNAKE_CASE:i64 = 9;
|
||||
```
|
||||
|
||||
### 注释
|
||||
|
||||
```rust
|
||||
// 行注释
|
||||
/*.............块注释 */
|
||||
/// 外部文档注释
|
||||
//! 内部文档评论
|
||||
```
|
||||
|
||||
另见: [注释](https://doc.rust-lang.org/reference/comments.html) _(doc.rust-lang.org)_
|
||||
|
||||
### 函数
|
||||
|
||||
```rust
|
||||
fn test(){
|
||||
println!("这是一个函数!");
|
||||
}
|
||||
fn main(){
|
||||
test();
|
||||
}
|
||||
```
|
||||
|
||||
查看: [Functions](#rust-函数)
|
||||
|
||||
Rust 类型
|
||||
--------
|
||||
|
||||
### 整数
|
||||
|
||||
```rust
|
||||
let mut a: u32 = 8;
|
||||
let b: u64 = 877;
|
||||
let c: i64 = 8999;
|
||||
let d = -90;
|
||||
```
|
||||
|
||||
### 浮点数
|
||||
|
||||
```rust
|
||||
let mut sixty_bit_float: f64 = 89.90;
|
||||
let thirty_two_bit_float: f32 = 7.90;
|
||||
let just_a_float = 69.69;
|
||||
```
|
||||
|
||||
### 布尔值
|
||||
|
||||
```rust
|
||||
let true_val: bool = true;
|
||||
let false_val: bool = false;
|
||||
let just_a_bool = true;
|
||||
let is_true = 8 < 5; // => false
|
||||
```
|
||||
|
||||
### 字符
|
||||
|
||||
```rust
|
||||
let first_letter_of_alphabet = 'a';
|
||||
let explicit_char: char = 'F';
|
||||
let implicit_char = '8';
|
||||
let emoji = "\u{1f600}"; // => 😀
|
||||
```
|
||||
|
||||
### 字符串字面量
|
||||
|
||||
```rust {.wrap}
|
||||
let community_name = "AXIAL";
|
||||
let no_of_members: &str = "ten";
|
||||
println!("社区的名称是 {community_name},它有 {no_of_members} 个成员");
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
查看: [字符串](#rust-字符串)
|
||||
|
||||
### 数组
|
||||
|
||||
```rust
|
||||
┌─────┬─────┬─────┬─────┬─────┬─────┐
|
||||
| 92 | 97 | 98 | 99 | 98 | 94 |
|
||||
└─────┴─────┴─────┴─────┴─────┴─────┘
|
||||
0 1 2 3 4 5
|
||||
```
|
||||
----
|
||||
|
||||
```rust
|
||||
let array: [i64; 6] = [92,97,98,99,98,94];
|
||||
```
|
||||
|
||||
### 多维数组
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```rust
|
||||
j0 j1 j2 j3 j4 j5
|
||||
┌────┬────┬────┬────┬────┬────┐
|
||||
i0 | 1 | 2 | 3 | 4 | 5 | 6 |
|
||||
├────┼────┼────┼────┼────┼────┤
|
||||
i1 | 6 | 5 | 4 | 3 | 2 | 1 |
|
||||
└────┴────┴────┴────┴────┴────┘
|
||||
```
|
||||
----
|
||||
|
||||
```rust
|
||||
let array: [[i64; 6] ;2] = [
|
||||
[1,2,3,4,5,6],
|
||||
[6,5,4,3,2,1]];
|
||||
```
|
||||
|
||||
### 可变数组
|
||||
|
||||
```rust
|
||||
let mut array: [i32 ; 3] = [2,6,10];
|
||||
array[1] = 4;
|
||||
array[2] = 6;
|
||||
```
|
||||
|
||||
使用 `mut` 关键字使其可变
|
||||
|
||||
### 切片
|
||||
|
||||
```rust
|
||||
let mut array: [ i64; 4] = [1,2,3,4];
|
||||
// 下限包括在内,上限不包括在内
|
||||
let mut slices: &[i64] = &array[0..3]
|
||||
println!("切片的元素是:{slices:?}");
|
||||
```
|
||||
|
||||
### 向量
|
||||
|
||||
```rust
|
||||
let some_vector = vec![1,2,3,4,5];
|
||||
```
|
||||
|
||||
使用 `vec!` 宏声明向量
|
||||
|
||||
### 元组
|
||||
|
||||
```rust
|
||||
let tuple = (1, 'A' , "Cool", 78, true);
|
||||
```
|
||||
|
||||
Rust 字符串
|
||||
--------------
|
||||
|
||||
### 字符串字面量
|
||||
|
||||
```rust
|
||||
let cs:&str = "备忘清单";
|
||||
// => 为开发者分享备忘单
|
||||
println!("为开发者分享 {cs}");
|
||||
```
|
||||
|
||||
### 字符串对象
|
||||
|
||||
```rust
|
||||
// 创建一个空字符串对象
|
||||
let my_string = String::new;
|
||||
// 转换为字符串对象
|
||||
let S_string = a_string.to_string()
|
||||
// 创建一个初始化的字符串对象
|
||||
let lang = String::from("Rust");
|
||||
println!("First language is {lang}");
|
||||
```
|
||||
|
||||
### .capacity()
|
||||
|
||||
```rust
|
||||
let rand = String::from("Random String");
|
||||
rand.capacity() // => 13
|
||||
```
|
||||
|
||||
以字节为单位计算字符串的容量
|
||||
|
||||
### .contains()
|
||||
|
||||
```rust
|
||||
let name = String::from("ElementalX");
|
||||
name.contains("Element") // => true
|
||||
```
|
||||
|
||||
检查子字符串是否包含在原始字符串中
|
||||
|
||||
### 添加单个字符
|
||||
|
||||
```rust
|
||||
let mut half_text = String::from("Hal");
|
||||
half_text.push('f'); // => Half
|
||||
```
|
||||
|
||||
### 添加整个字符串
|
||||
|
||||
```rust
|
||||
let mut hi = String::from("Hey there...");
|
||||
hi.push_str("How are you doing??");
|
||||
// => Hey there...How are you doing??
|
||||
println!("{hi}");
|
||||
```
|
||||
|
||||
Rust 运算符
|
||||
-----------
|
||||
|
||||
### 比较运算符
|
||||
|
||||
:-|:-
|
||||
:-|:-
|
||||
`e == f` | `e` 等于 `f`
|
||||
`e != f` | `e` 不等于 `f`
|
||||
`e < f` | `e` 小于 `f`
|
||||
`e > f` | `e` 大于 `f`
|
||||
`e <= f` | `e` 小于或等于 `f`
|
||||
`e >= f` | `e` 大于或等于 `f`
|
||||
|
||||
---------
|
||||
|
||||
```rust
|
||||
let (e, f) = (1, 100);
|
||||
let greater = f > e; // => true
|
||||
let less = f < e; // => false
|
||||
let greater_equal = f >= e; // => true
|
||||
let less_equal = e <= f; // => true
|
||||
let equal_to = e == f; // => false
|
||||
let not_equal_to = e != f; // => true
|
||||
```
|
||||
|
||||
### 算术运算符
|
||||
|
||||
:-|:-
|
||||
:-|:-
|
||||
`a + b` | `a` 被添加到 `b`
|
||||
`a - b` | 从 `a` 中减去`b`
|
||||
`a / b` | `a` 除以 `b`
|
||||
`a % b` | 通过与 `b` 相除得到 `a` 的余数
|
||||
`a * b` | `a` 与 `b` 相乘
|
||||
|
||||
------
|
||||
|
||||
```rust
|
||||
let (a, b) = (4, 5);
|
||||
let sum: i32 = a + b; // => 9
|
||||
let subtractions: i32 = a - b; // => -1
|
||||
let multiplication: i32 = a * b; // => 20
|
||||
let division: i32 = a / b; // => 0
|
||||
let modulus: i32 = a % b; // => 4
|
||||
```
|
||||
|
||||
### 位运算符
|
||||
|
||||
运算符 | 描述
|
||||
:- | :-
|
||||
`g & h` | 二进制与
|
||||
`g | h` | 二进制或
|
||||
`g ^ h` | 二进制异或
|
||||
`g ~ h` | 二进制补码
|
||||
`g << h` | 二进制左移
|
||||
`g >> h` | 二进制右移
|
||||
|
||||
-----
|
||||
|
||||
```rust
|
||||
let (g, h) = (0x1, 0x2);
|
||||
let bitwise_and = g & h; // => 0
|
||||
let bitwise_or = g | h; // => 3
|
||||
let bitwise_xor = g ^ h; // => 3
|
||||
let right_shift = g >> 2; // => 0
|
||||
let left_shift = h << 4; // => 32
|
||||
```
|
||||
|
||||
### 逻辑运算符
|
||||
|
||||
示例 | 意义
|
||||
:- | :-
|
||||
`c && d` | 两者都是真的_(AND)_
|
||||
`c || d` | 要么是真的_(OR)_
|
||||
`!c` | `c` 为假 _(NOT)_
|
||||
|
||||
------
|
||||
|
||||
```rust
|
||||
let (c, d) = (true, false);
|
||||
let and = c && d; // => false
|
||||
let or = c || d; // => true
|
||||
let not = !c; // => false
|
||||
```
|
||||
|
||||
### 复合赋值运算符
|
||||
|
||||
```rust
|
||||
let mut k = 9;
|
||||
let mut l = k;
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
运算符 | 描述
|
||||
:- | :-
|
||||
`k += l` | 添加一个值并赋值,然后 `k=9`
|
||||
`k -= l` | `Substrate` 一个值并赋值,然后 `k=18`
|
||||
`k /= l` | 除以一个值并赋值,然后 `k=9`
|
||||
`k *= l` | 乘一个值并赋值,然后 `k=81`
|
||||
`k \|= l` | 按位或并赋值,则 `k=89`
|
||||
|
||||
Rust 流程控制
|
||||
------------
|
||||
|
||||
### If表达式
|
||||
|
||||
```rust
|
||||
let case1: i32 = 81;
|
||||
let case2: i32 = 82;
|
||||
if case1 < case2 {
|
||||
println!("case1 大于 case2");
|
||||
}
|
||||
```
|
||||
|
||||
### If...Else 表达式
|
||||
|
||||
```rust
|
||||
let case3 = 8;
|
||||
let case4 = 9;
|
||||
if case3 >= case4 {
|
||||
println!("case3 优于 case4");
|
||||
} else {
|
||||
println!("case4 大于 case3");
|
||||
}
|
||||
```
|
||||
|
||||
### If...Else...if...Else 表达式
|
||||
|
||||
```rust
|
||||
let foo = 12;
|
||||
let bar = 13;
|
||||
if foo == bar {
|
||||
println!("foo 等于 bar");
|
||||
} else if foo < bar {
|
||||
println!("foo 小于 bar");
|
||||
} else if foo != bar {
|
||||
println!("foo 不等于 bar");
|
||||
} else {
|
||||
println!("Nothing");
|
||||
}
|
||||
```
|
||||
|
||||
### If...let 表达式
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```rust
|
||||
let mut arr1:[i64 ; 3] = [1,2,3];
|
||||
if let[1,2,_] = arr1{
|
||||
println!("与数组一起使用");
|
||||
}
|
||||
let mut arr2:[&str; 2] = ["one", "two"];
|
||||
if let["Apple", _] = arr2{
|
||||
println!("也适用于 str 数组");
|
||||
}
|
||||
```
|
||||
----
|
||||
```rust
|
||||
let tuple_1 = ("India", 7, 90, 90.432);
|
||||
if let(_, 7, 9, 78.99) = tuple_1{
|
||||
println!("也适用于元组");
|
||||
}
|
||||
let tuple_2 = ( 9, 7, 89, 12, "Okay");
|
||||
if let(9, 7,89, 12, blank) = tuple_2 {
|
||||
println!("一切{blank}伴侣?");
|
||||
}
|
||||
let tuple_3 = (89, 90, "Yes");
|
||||
if let(9, 89, "Yes") = tuple_3{
|
||||
println!("模式确实匹配");
|
||||
}
|
||||
else {
|
||||
println!("模式不匹配");
|
||||
}
|
||||
```
|
||||
|
||||
### 匹配表达式
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```rust
|
||||
let day_of_week = 2;
|
||||
match day_of_week {
|
||||
1 => {
|
||||
println!("兄弟们今天是星期一");
|
||||
},
|
||||
2 => {
|
||||
println!("兄弟们今天是星期二");
|
||||
},
|
||||
3 => {
|
||||
println!("兄弟们今天是星期三");
|
||||
},
|
||||
4 => {
|
||||
println!("兄弟们今天是星期四");
|
||||
},
|
||||
5 => {
|
||||
println!("兄弟们今天是星期五");
|
||||
},
|
||||
6 => {
|
||||
println!("兄弟们今天是星期六");
|
||||
},
|
||||
7 => {
|
||||
println!("兄弟们今天是星期天");
|
||||
},
|
||||
_ => {
|
||||
println!("默认!")
|
||||
}
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### 嵌套...If 表达式
|
||||
|
||||
```rust
|
||||
let nested_conditions = 89;
|
||||
if nested_conditions == 89 {
|
||||
let just_a_value = 98;
|
||||
if just_a_value >= 97 {
|
||||
println!("大于 97");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### For 循环
|
||||
|
||||
```rust
|
||||
for mut i in 0..15 {
|
||||
i-=1;
|
||||
println!("i 的值为:{i}");
|
||||
}
|
||||
```
|
||||
|
||||
### While 循环
|
||||
|
||||
```rust
|
||||
let mut check = 0;
|
||||
while check < 11{
|
||||
println!("check 是:{check}");
|
||||
check+=1;
|
||||
println!("递增后:{check}");
|
||||
if check == 10{
|
||||
break; // 停止 while
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Loop 关键字
|
||||
|
||||
```rust
|
||||
loop {
|
||||
println!("你好,世界永远!");
|
||||
}
|
||||
```
|
||||
|
||||
无限循环表示
|
||||
|
||||
### Break 中断语句
|
||||
|
||||
```rust
|
||||
let mut i = 1;
|
||||
loop {
|
||||
println!("i 是 {i}");
|
||||
if i > 100 {
|
||||
break;
|
||||
}
|
||||
i *= 2;
|
||||
}
|
||||
```
|
||||
|
||||
### Continue 继续声明
|
||||
|
||||
```rust
|
||||
for (v, c) in (0..10+1).enumerate(){
|
||||
println!("{c} 数字循环");
|
||||
if v == 9{
|
||||
println!("我们继续?");
|
||||
continue;
|
||||
}
|
||||
println!{"v 的值为:{v}"};
|
||||
}
|
||||
```
|
||||
|
||||
Rust 函数
|
||||
--------
|
||||
|
||||
### 基本函数
|
||||
|
||||
```rust
|
||||
fn print_message(){
|
||||
println!("Hello, Quick Reference!");
|
||||
}
|
||||
fn main(){
|
||||
// 在 Rust 中调用函数
|
||||
print_message();
|
||||
}
|
||||
```
|
||||
|
||||
### 按值传递
|
||||
|
||||
```rust
|
||||
fn main()
|
||||
{
|
||||
let x:u32 = 10;
|
||||
let y:u32 = 20;
|
||||
|
||||
// => 200
|
||||
println!("计算: {}", cal_rect(x, y));
|
||||
}
|
||||
fn cal_rect(x:u32, y:u32) -> u32
|
||||
{
|
||||
x * y
|
||||
}
|
||||
```
|
||||
|
||||
### 通过引用传递
|
||||
|
||||
```rust
|
||||
fn main(){
|
||||
let mut by_ref = 3; // => 3
|
||||
power_of_three(&mut by_ref);
|
||||
println!("{by_ref}"); // => 9
|
||||
}
|
||||
fn power_of_three(by_ref: &mut i32){
|
||||
// 取消引用很重要
|
||||
*by_ref = *by_ref * *by_ref;
|
||||
println!("{by_ref}"); // => 9
|
||||
}
|
||||
```
|
||||
|
||||
### 返回
|
||||
|
||||
```rust
|
||||
fn main(){
|
||||
let (mut radius, mut pi) = (3.0, 3.14);
|
||||
let(area, _perimeter) = calculate (
|
||||
&mut radius,
|
||||
&mut pi
|
||||
);
|
||||
println!("圆的面积和周长为:{area} & {_perimeter}");
|
||||
}
|
||||
fn calculate(radius : &mut f64, pi: &mut f64) -> (f64, f64){
|
||||
let perimeter = 2.0 * *pi * *radius;
|
||||
let area = *pi * *radius * *radius;
|
||||
return (area, perimeter);
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
### 数组作为参数
|
||||
|
||||
```rust
|
||||
fn main(){
|
||||
let mut array: [i32 ; 5] = [1,2,3,4,6];
|
||||
print_arrays(array);
|
||||
println!("元素:{array:?}");
|
||||
}
|
||||
fn print_arrays(mut array:[i32; 5]) {
|
||||
array[0] = 89;
|
||||
array[1] = 90;
|
||||
array[2] = 91;
|
||||
array[3] = 92;
|
||||
array[4] = 93;
|
||||
println!("元素:{array:?}");
|
||||
}
|
||||
```
|
||||
|
||||
### 返回数组
|
||||
|
||||
```rust
|
||||
fn main(){
|
||||
let mut arr:[i32; 5] = [2,4,6,8,10];
|
||||
multiply(arr);
|
||||
println!("数组是:{:?}", multiply(arr));
|
||||
}
|
||||
fn multiply (mut arr: [i32 ; 5]) -> [i32 ; 5]{
|
||||
arr[2] = 90;
|
||||
for mut i in 0..5 {
|
||||
arr[i] = arr[i] * arr[2];
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
杂项
|
||||
-----
|
||||
|
||||
### 类型断言 type-casting
|
||||
|
||||
```rust
|
||||
let a_int = 90; // int
|
||||
// int 到 float
|
||||
let mut type_cast = (a_int as f64);
|
||||
```
|
||||
------
|
||||
```rust
|
||||
let orginal: char = 'I';
|
||||
// char 到 int => 73
|
||||
let type_casted: i64 = orginal as i64;
|
||||
```
|
||||
|
||||
要在 `Rust` 中执行类型转换,必须使用 `as` 关键字
|
||||
|
||||
### 借用
|
||||
|
||||
```rust
|
||||
let mut foo = 4;
|
||||
let mut borrowed_foo = &foo;
|
||||
println!("{borrowed_foo}");
|
||||
```
|
||||
------
|
||||
```rust
|
||||
let mut bar = 3;
|
||||
let mut mutable_borrowed_bar = &mut bar;
|
||||
println!("{mutable_borrowed_bar}");
|
||||
```
|
||||
|
||||
这里借用的值使用 `&` 运算符从值一中借用值
|
||||
|
||||
### 取消引用
|
||||
|
||||
```rust
|
||||
let mut borrow = 10;
|
||||
let deref = &mut borrow;
|
||||
println!("{}", *deref);
|
||||
```
|
||||
|
||||
可以使用 `*` 操作符在 rust 中取消引用
|
||||
|
||||
### 变量范围
|
||||
|
||||
```rust
|
||||
{
|
||||
// 范围仅限于此大括号
|
||||
let a_number = 1;
|
||||
}
|
||||
println!("{a_number}");
|
||||
```
|
||||
|
||||
这将产生错误,因为变量 `a_number` 的范围在大括号处结束
|
||||
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [The Rust Document](https://doc.rust-lang.org/book/ch00-00-introduction.html) _(doc.rust-lang.org)_
|
||||
- [The Rust Reference](https://doc.rust-lang.org/reference/introduction.html) _(doc.rust-lang.org)_
|
||||
- [Rust Cheatsheet](https://phaiax.github.io/rust-cheatsheet/) _(phaiax.github.io)_
|
||||
- [Rust 标准库文档中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/std/std/) _(jaywcjlove.github.io)_
|
||||
- [Rust 程序设计语言 中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/book/) _(jaywcjlove.github.io)_
|
||||
- [Rust By Example 中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/rust-by-example-cn/) _(jaywcjlove.github.io)_
|
||||
- [Rust 参考手册中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/reference/) _(jaywcjlove.github.io)_
|
||||
- [RustDoc 手册中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/rustdoc/) _(jaywcjlove.github.io)_
|
||||
- [Rust Cookbook 中文版](https://jaywcjlove.github.io/rust-cn-document-for-docker/rust-cookbook/) _(jaywcjlove.github.io)_
|
3
scripts/assets/rust.svg
Normal file
3
scripts/assets/rust.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="1em" height="1em" viewBox="0 0 32 32">
|
||||
<path d="M15 3.77a.951.951 0 1 1 1.902 0 .951.951 0 0 1-1.902 0M3.654 12.38a.951.951 0 1 1 1.902 0 .951.951 0 0 1-1.902 0m22.692.044a.951.951 0 0 1 1.902 0 .951.951 0 0 1-1.902 0M6.406 13.73a.87.87 0 0 0 .441-1.146l-.422-.954h1.66v7.48H4.736a11.71 11.71 0 0 1-.379-4.47zm6.942.184v-2.205H17.3c.204 0 1.44.236 1.44 1.16 0 .768-.95 1.044-1.73 1.044zM7.952 25.785a.951.951 0 1 1 1.902 0 .951.951 0 0 1-1.902 0m14.093.044a.951.951 0 0 1 1.902 0 .951.951 0 0 1-1.902 0m.294-2.157a.867.867 0 0 0-1.03.667l-.477 2.228a11.71 11.71 0 0 1-9.765-.047l-.477-2.228a.865.865 0 0 0-1.03-.667l-1.967.422a11.71 11.71 0 0 1-1.017-1.199h9.57c.108 0 .18-.02.18-.118v-3.385c0-.1-.072-.118-.18-.118h-2.8v-2.146h3.027c.276 0 1.477.08 1.862 1.614l.565 2.5c.18.55.913 1.653 1.693 1.653h4.94a11.71 11.71 0 0 1-1.085 1.255zm5.314-8.938a11.71 11.71 0 0 1 .025 2.033h-1.2c-.12 0-.17.08-.17.197v.552c0 1.3-.732 1.58-1.374 1.653-.61.07-1.29-.256-1.372-.63-.36-2.028-.96-2.46-1.9-3.21 1.177-.748 2.402-1.85 2.402-3.327 0-1.594-1.093-2.598-1.838-3.09-1.045-.69-2.202-.827-2.514-.827H7.277a11.71 11.71 0 0 1 6.551-3.697l1.465 1.537c.33.347.88.36 1.226.028l1.64-1.567a11.71 11.71 0 0 1 8.017 5.709l-1.122 2.534a.87.87 0 0 0 .441 1.146zm2.798.04-.038-.392 1.156-1.078c.235-.22.147-.66-.153-.772l-1.477-.552-.116-.38.92-1.28c.188-.26.015-.675-.3-.727l-1.558-.253-.187-.35.655-1.437c.134-.293-.115-.667-.437-.655l-1.58.055-.25-.303.363-1.54c.073-.313-.244-.63-.557-.557l-1.54.363-.304-.25.055-1.58c.012-.32-.362-.57-.654-.437l-1.436.655-.35-.188-.254-1.558c-.05-.316-.467-.488-.727-.3l-1.28.92-.38-.115L19.47.586c-.112-.3-.553-.388-.772-.154L17.62 1.588l-.392-.038-.832-1.345c-.168-.272-.62-.272-.787 0l-.832 1.345-.392.038L13.305.43c-.22-.234-.66-.147-.772.154l-.552 1.477-.38.115-1.28-.92c-.26-.188-.676-.015-.727.3L9.34 3.114l-.35.188-1.436-.655c-.292-.133-.667.117-.654.437l.055 1.58-.304.25-1.54-.363c-.313-.073-.63.244-.557.557l.363 1.54-.25.303-1.58-.055c-.32-.01-.57.362-.437.655l.655 1.437-.188.35-1.558.253c-.316.05-.488.467-.3.727l.92 1.28-.116.38-1.477.552c-.3.112-.388.553-.153.772l1.156 1.078-.038.392-1.345.832c-.272.168-.272.62 0 .787l1.345.832.038.392L.43 18.697c-.234.22-.147.66.153.772l1.477.552.116.38-.92 1.28c-.187.26-.015.676.3.727l1.557.253.188.35-.655 1.436c-.133.292.118.667.437.655l1.58-.055.25.304-.363 1.54c-.073.312.244.63.557.556l1.54-.363.304.25-.055 1.58c-.012.32.362.57.654.437l1.436-.655.35.188.254 1.557c.05.317.467.488.727.302l1.28-.922.38.116.552 1.477c.112.3.553.388.772.153l1.078-1.156.392.04.832 1.345c.168.27.618.272.787 0l.832-1.345.392-.04 1.078 1.156c.22.235.66.147.772-.153l.552-1.477.38-.116 1.28.922c.26.187.676.015.727-.302l.254-1.557.35-.188 1.436.655c.292.133.666-.116.654-.437l-.055-1.58.303-.25 1.54.363c.313.073.63-.244.557-.556l-.363-1.54.25-.304 1.58.055c.32.013.57-.363.437-.655l-.655-1.436.187-.35 1.558-.253c.317-.05.49-.466.3-.727l-.92-1.28.116-.38 1.477-.552c.3-.113.388-.553.153-.772l-1.156-1.078.038-.392 1.345-.832c.272-.168.273-.618 0-.787z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
Loading…
x
Reference in New Issue
Block a user