🦀初见Rust:编程界的原神

password
icon
AI summary
type
status
date
slug
summary
tags
category
Property
Oct 21, 2024 04:51 PM

学习资料

  • rustlings:在VsCode中练习,有很多练习题
  • 极客时间:Rust训练营

环境安装

windows用户参见:https://rustup.rs/
先下一个Visual Studio,再运行rustup-init.exe按命令行指示操作即可

Rust基础

1. Variables and Mutability

关于let

输出:
The value of x in the inner scope is: 12
The value of x is: 6
这里每用一次let,就相当于新命名了一个变量,称为一次”Shadowing”。
 

变量类型

Length
Signed
Unsigned
8-bit
i8
u8
16-bit
i16
u16
32-bit
i32
u32
64-bit
i64
u64
128-bit
i128
u128
arch
isize
usize

2. 语法单元概览

  • struct/structure:结构体
  • enum:枚举
  • variable:变量
  • constant:常量
  • static:静态变量
  • function:函数
  • method:方法
  • generics:泛型
  • trait:特征/特质
  • trait bound:特征约束/trait 约束

Rust的几大特性

类型系统和基本数据结构

 

Rust项目

 
上一篇
HJ机试题目整理
下一篇
Django框架课—7实现联机对战
Loading...
文章列表
Love & Share 分享热爱
🐙Java
🤖科研
🧱编程四大件
👨‍💻算法
🦀Rust
🐍Python
🛞Linux
🐎比赛
🐼C++
🌀日常使用