# learn_rust **Repository Path**: yluuu/learn_rust ## Basic Information - **Project Name**: learn_rust - **Description**: 我的rust基础学习。 - **Primary Language**: Rust - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-11-07 - **Last Updated**: 2022-12-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 我的 Rust 入门 跟随B站视频学习:https://www.bilibili.com/video/BV1hp4y1k7SV - [1 Rust安装与HelloWorld](#1-rust安装与helloworld) - [1.1 Rust安装升级及相关配置](#11-rust安装升级及相关配置) - [(1) Rust安装](#1-rust安装) - [(2) Rust升级](#2-rust升级) - [(3) Rust本地文档](#3-rust本地文档) - [(4) 开发工具](#4-开发工具) - [(5) Rust卸载](#5-rust卸载) - [(6) Rustup 更换国内源](#6-rustup-更换国内源) - [(7) Cargo 使用代理](#7-cargo-使用代理) - [1.2 使用 rustc 开始 Hello World](#12-使用-rustc-开始-hello-world) - [1.3 使用 Cargo 开始 Hello World](#13-使用-cargo-开始-hello-world) - [(1) 使用Cargo创建项目](#1-使用cargo创建项目) - [Cargo.toml文件解析](#cargotoml文件解析) - [(2) 构建Cargo项目](#2-构建cargo项目) - [a. cargo build](#a-cargo-build) - [2 猜数游戏](#2-猜数游戏) - [2.1 单次猜测](#21-单次猜测) - [2.2 生成一个神秘数字](#22-生成一个神秘数字) - [2.3 比较神秘数字和猜测数字](#23-比较神秘数字和猜测数字) - [2.4 实现多次猜测](#24-实现多次猜测) - [3 通用的编程概念](#3-通用的编程概念) - [3.1 变量与可变性](#31-变量与可变性) - [3.2 数据类型](#32-数据类型) - [(1) 标量类型](#1-标量类型) - [a. 整数类型](#a-整数类型) - [b. 浮点类型](#b-浮点类型) - [c. 数值操作](#c-数值操作) - [d. 布尔类型](#d-布尔类型) - [e. 字符类型](#e-字符类型) - [(2) 复合类型](#2-复合类型) - [a. Tuple](#a-tuple) - [b. 数组](#b-数组) - [3.3 函数](#33-函数) - [(1) 函数的参数](#1-函数的参数) - [(2) 语句(statement)和表达式(expression)](#2-语句statement和表达式expression) - [(3) 函数的返回值](#3-函数的返回值) - [3.4 控制流](#34-控制流) - [(1) 条件表达式](#1-条件表达式) - [(2) 循环](#2-循环) - [a. loop 循环](#a-loop-循环) - [b. while 循环](#b-while-循环) - [c. for 循环](#c-for-循环) - [4 所有权](#4-所有权) - [4.1 所有权的相关概念](#41-所有权的相关概念) - [(1) 什么是所有权](#1-什么是所有权) - [(2) 所有权相关概念](#2-所有权相关概念) - [(3) 所有权与函数](#3-所有权与函数) - [4.2 引用与借用](#42-引用与借用) - [4.3 切片](#43-切片) - [5 struct 结构体](#5-struct-结构体) - [5.1 定义并实例化 struct](#51-定义并实例化-struct) - [5.2 struct 的例子](#52-struct-的例子) - [5.3 struct 的方法](#53-struct-的方法) - [6 枚举与模式匹配](#6-枚举与模式匹配) - [6.1 定义枚举](#61-定义枚举) - [6.2 Option 枚举](#62-option-枚举) - [6.3 控制流运算符 - match](#63-控制流运算符-match) - [6.4 if let](#64-if-let)