baicai

白菜

一个勤奋的代码搬运工!

Rust 學習指南

了解#

一般來說,要決定學習一門新語言之前,會先大致了解這門語言的特點和目前的發展情況。
這時,建議看 Rust 官網 https://rust-lang.org

Rust 官方文檔#

Rust 語言的學習或參考文檔大都列在 Rust 學習指引頁Rust 官方文檔首頁 上,目前 Rust 官方團隊已經將相關文檔拆分到不同的倉庫上:

還有其他更多官方或其他非官方相關的文檔:

上述文檔的源文件有些是放在 rustcargo 的倉庫的子目錄中:Rust 文檔cargo 文檔

Rust 資源#

Rust 相關的中文資源,包括網站,或者國內的 Rust 的文章或書籍。

Rust 相關的中文網站#

以下列出目前搜集到的 Rust 中文網站:

Rust 語言中文社區:https://rust.cc/

Rust Wiki 網:https://rustwiki.org/

Rust 語言術語中英文對照表#

👉 部分來自 Rust 語言術語中英文對照表倉庫,收錄在此處,只是方便 Rust 學習者統一查閱,若是發現有任何錯誤或需要完善地方,請在原倉庫指出或修改錯誤。

English 英文Chinese 中文Note 备注
A
Abstract Syntax Tree抽象語法樹
ABI應用程序二進制接口Application Binary Interface 縮寫
accumulator累加器
accumulator variable累加器變量
ahead-of-time compiled預編譯
ahead-of-time compiled language預編譯語言
alias別名
aliasing別名使用參見 Wikipedia
angle brackets尖括號,“<” 和 “>”
annotate標註,注明(動詞)
annotation標註,注明(名詞)
ARC原子引用計數器Atomic Referecne Counter
anonymity匿名
argument參數,實參,實際參數不嚴格區分的話, argument(參數)和
parameter(參量)可以互換地使用
argument type參數類型
assignment赋值
associated functions關聯函數
associated items關聯項
associated types關聯類型
asterisk星號(*)
atomic原子的
attribute屬性
automated building自動構建
automated test自動測試,自動化測試
B
baroque macro巴洛克宏
benchmark基準
binary二進制的
binary executable二進制的可執行文件
bind綁定
block語句塊,代碼塊
boolean布爾型,布爾值
borrow check借用檢查
borrower借用者,借入者
borrowing借用
bound約束,限定,限制此詞和 constraint 意思相近,
constraint 在 C# 語言中翻譯成 “約束”
box箱子,盒子,裝箱類型一般不譯,作動詞時翻譯成 “裝箱”,
具有所有權的智能指針
boxed裝箱,裝包
boxing裝箱,裝包
brace大括號,“{” 或 “}”
buffer緩衝,緩衝區,緩衝器,緩存
build構建
builder pattern創建者模式
C
call調用
caller調用者
capacity容器
capture捕獲
cargo(Rust 包管理器,不譯)該詞作名詞時意思是 “貨物”,
作動詞時意思是 “裝載貨物”
cargo-fyCargo 化,使用 Cargo 創建項目
case analysis事例分析
cast類型轉換,轉型
casting類型轉換
chaining method call鏈式方法調用
channel信道,通道
closure閉包
coercion強制類型轉換,強制轉換coercion 原意是 “強制,脅迫”
collection集合參見 Wikipedia
combinator組合算子,組合器
comma逗號,“,”
command命令
command line命令行
comment註釋
compile編譯(動詞)
compile time編譯期,編譯期間,編譯時
compilation編譯(名詞)
compilation unit編譯單元
compiler編譯器
compiler intrinsics編譯器固有功能
compound複合(類型,數據)
concurrency並發
conditional compilation條件編譯
configuration配置
constructor構造器
consumer消費者
container容器
container type容器類型
convert轉換,轉化,轉
copy複製,拷貝
crate包,包裝箱,裝包一般不譯,crate 是 Rust 的基本編譯單元
curly braces大括號,包含 “{” 和 “}”
custom type自定義類型
D
dangling pointer懸垂指針use after free 在釋放後使用
data race數據競爭
dead code死代碼,無效代碼,不可達代碼
deallocate釋放,重新分配
declare聲明
deep copy深拷貝,深複製
dependency依賴
deref coercions強制多態
dereference解引用Rust 文章中有時簡寫為 Deref
derive派生
designator指示符
destruction銷毀,毀滅
destructor析構器,析構函數
destructure解構
destructuring解構,解構賦值
desugar脫糖
diverge function發散函數
device drive設備驅動
directory目錄
dispatch分發
diverging functions發散函數
documentation文檔
dot operator點運算符
DST動態大小類型dynamic sized type,一般不譯,
使用英文縮寫形式
dynamic language動態類型語言
dynamic trait type動態特質類型
E
enumeration枚舉
encapsulation封裝
equality test相等測試
elision省略
exhaustiveness checking窮盡性檢查,無遺漏檢查
expression表達式
expression-oriented language面向表達式的語言
explicit顯式
explicit discriminator顯式的辨別值
explicit type conversion顯式類型轉換
extension擴展名
extern外,外部作關鍵字時不譯
F
fat pointer胖指針
feature gate功能開關
field字段
field-level mutability字段級別可變性
file文件
fmt格式化,是 format 的縮寫
formatter格式化程序,格式化工具,格式器
floating-point number浮點數
flow control流程控制
Foreign Function Interface(FFI)外部語言函數接口
fragment specifier片段分類符
free variables自由變量
freeze凍結
function函數
function declaration函數聲明
functional函數式
G
garbage collector垃圾回收
generalize泛化,泛型化
generator生成器
generic泛型
generic type泛型類型
growable可增長的
guard守衛
H
handle error句柄錯誤
hash哈希,哈希值,散列
hash map散列映射,哈希表
heap
hierarchy層次,分層,層次結構
higher rank lifetime高階生命週期
higher rank trait bound高階特質約束
higher tank type高階類型
hygiene衛生
hygienic macro system衛生宏系統
I
ICE編譯內部錯誤internal comppiler error 的縮寫
immutable不可變的
implement實現
implementor實現者
implicit隱式
implicit discriminator隱式的辨別值
implicit type conversion隱式類型轉換
import導入
in assignment在賦值(語句)
index索引英語複數形式:indices
infer推導(動詞)
inference推導(名詞)
inherited mutability承襲可變性
inheritance繼承
integrated development
environment(IDE)
集成開發環境中文著作中通常直接寫成 IDE
integration-style test集成測試
interior mutability內部可變性
installer安裝程序,安裝器
instance實例
instance method實例方法
integer整型,整數
interact相互作用,相互影響
interior mutability內部可變性
intrinsic固有的
invoke調用
item項,條目,項目
iterate重複
iteration迭代
iterator迭代器
iterator adaptors迭代器適配器
iterator invalidation迭代器失效
L
LHS左操作數left-hand side 的非正式縮寫,
與 RHS 相對
lender借出者
library
lifetime生存時間,壽命,生命週期
lifetime elision生命週期省略
link鏈接
linked-list鏈表
lint(不譯)lint 英文本義是 “紗布,絨毛”,此詞在
計算機領域中表示程序代碼中可疑和
不具結構性的片段,參見 Wikipedia
list列表
listener監聽器
literal數據,常量數據,字面值,字面量,
字面常量,字面上的
英文意思:字面意義的(內容)
LLVM(不譯)Low Level Virtual Machine 的縮寫,
是構建編譯器的系統
loop循環作關鍵字時不譯
low-level code底層代碼
low-level language底層語言
l-value左值
M
main functionmain 函數,主函數
macro
map映射一般不譯
match guard匹配守衛
memory內存
memory leak內存泄露
memory safe內存安全
meta原則,元
metadata元數據
metaprogramming元編程
metavariable元變量
method call syntax方法調用語法
method chaining方法鏈
method definition方法定義
modifier修飾符
module模塊
monomorphization單態mono: one, morph: form
move移動,轉移按照 Rust 所規定的內容,
英語單詞 transfer 的意思
比 move 更貼合實際描述
參考:Rust by Example
move semantics移動語義
mutability可變性
mutable可變
mutable reference可變引用
multiple bounds多重約束
mutiple patterns多重模式
N
nest嵌套
Nightly RustRust 開發版nightly 本意是 “每夜,每天晚上”,
指代碼每天都更新
NLL非詞法生命週期non lexical lifetime 的縮寫,
一般不譯
non-copy type非複製類型
non-generic非泛型
no-op空操作,空運算(此詞出現在類型轉換章節中)
non-commutative非交換的
non-scalar cast非標量轉換
notation符號,記號
numeric數值,數字
O
optimization優化
out-of-bounds accessing越界訪問
orphan rule孤兒規則
overflow溢出,越界
own占有,擁有
owner所有者,擁有者
ownership所有權
P
package manager包管理器,軟件包管理器
panic(不譯)此單詞直接翻譯是 “恐慌”,
在 Rust 中用於不可恢復的錯誤處理
parameter參量,形參,形式參量不嚴格區分的話, argument(參數)和
parameter(參量)可以互換地使用
parametric polymorphism參數多態
parent scope父級作用域
parentheses小括號,包括 “(” 和 “)”
parse分析,解析
parser(語法)分析器,解析器
pattern模式
pattern match模式匹配
phantom type虛類型,虛位類型phantom 相關的專有名詞:
phantom bug 幻影指令
phantom power 幻象電源
參見:HaskellHaskell/Phantom_type
Rust/Phantomstdlib/PhantomData
platform平台
polymorphism多態
powershell(不譯)Windows 系統的一種命令行外殼程序
和腳本環境
possibility of absence不存在的可能性
precede預先?,在... 發生(或出現)
prelude(不譯)預先導入模塊,英文本義:序曲,前奏
primitive types原生類型,基本類型,簡單類型
print打印
process進程
procedural macros過程宏,程序宏
project項目,工程
prototype原型
R
race condition競態條件
RAII資源獲取即初始化(一般不譯)resource acquisition is initialization 的縮寫
range區間,範圍
range expression區間表達式
raw identifier原始標識符
raw pointer原始指針,裸指針
RC引用計數reference counted
Reader讀取器
recursive macro递归宏
reference引用
reference cycle引用循環
release發布
resource資源
resource leak資源泄露
RHS右操作數right-hand side 的非正式縮寫,
與 LHS 相對
root directory根目錄
runtime運行時
runtime behavior運行時行為
runtime overhead運行時開銷
Rust(不譯)一種編程語言
Rustacean(不譯)編寫 Rust 的程序員或愛好者的通稱
rustc(不譯)Rust 語言編譯器
r-value右值
S
scalar標量,數量
schedule調度
scope作用域
screen屏幕
script腳本
semicolon分號,“;”
self自身,作關鍵字時不譯
shadow遮蔽,隱蔽,隱藏,覆蓋
shallow copy淺拷貝,淺複製
signature標記
slice切片
snake case蛇形命名參見:Snake case
source file源文件
source code源代碼
specialization泛型特化
square平方,二次方,二次幂
square brackets中括號,“[” 和 “]”
src(不譯)source 的縮寫,指源代碼
stack
stack unwind堆解開、堆展開
statement語句
statically allocated靜態分配
statically allocated string靜態分配的字符串
statically dispatch靜態分發
static method靜態方法
string字符串
string literal字符串常量
string slices字符串片段
stringify字符串化
subscript notation下標
sugar
super父級,作關鍵字時不譯
syntax context語法上下文
systems programming language系統級編程語言
T
tagged union標記聯合
target triple多層次指標,三層 / 重 指標 / 目標triple 本義是 “三”,但此處虛指 “多”,
此詞翻譯需要更多討論
terminal終端
testing測試
testsuit測試套件
the least significant bit (LSB)最低數字位
the most significant bit (MSB)最高數字位
thread線程
TOML(不譯)Tom's Obvious, Minimal Language
的縮寫,一種配置語言
token tree令牌樹?待進一步斟酌
trait特質其字面上有 “特性,特徵” 之意
trait bound特質約束bound 有 “約束,限制,限定” 之意
trait object特質對象
transmute(不譯)其字面上有 “變化,變形,變異” 之意,
不作翻譯
trivial平凡的
troubleshooting疑難解答,故障診斷,
故障排除,故障分析
tuple元組
two's complement補碼,二補數
two-word object雙字對象
type annotation類型標註
type erasure類型擦除
type inference類型推導
type inference engine類型推導引擎
type parameter類型參量
type placeholder類型佔位符
type signature類型標記
U
undefined behavior未定義行為
uninstall卸載
unit-like struct類單元構造體
unit struct單元結構體
"unit-style" tests單元測試
unit test單元測試
unit type單元類型
universal function call syntax
(UFCS)
通用函數調用語法
unsized types不定長類型
unwind展開
unwrap解包暫譯!
V
variable binding變量綁定
variable shadowing變量遮蔽,變量隱蔽,
變量隱藏,變量覆蓋
variable capture變量捕獲
variant變量
vector(動態數組,一般不譯)vector 本義是 “向量”
visibility可見性
vtable虛表
W
where clausewhere 子句,where 從句,where 分句在數據庫的官方手冊中多翻譯成 “子句”,英語語法中翻譯成 “從句”
wrap包裹暫譯!
wrapped裝包
wrapper裝包
Y
yield產生 (收益、效益等),產出,提供
Z
zero-cost abstractions零開銷抽象
zero-width space(ZWSP)零寬空格
載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。