术语表 (Glossary)

Purpose: Bilingual terminology reference (中文 ↔ English) for consistent translation across all documentation chapters

Created: 2026-04-03
Branch: 001-rust-tutorial-docs
Usage: Reference this glossary when writing chapters to ensure terminology consistency


核心概念 (Core Concepts)

English中文First Use FormatNotes
Ownership所有权所有权 (ownership)Rust's core resource management concept
Borrowing借用借用 (borrowing)Temporary access to data without taking ownership
Lifetime生命周期生命周期 (lifetime)Scope for which a reference is valid
Reference引用引用 (reference)Pointer to data without ownership
Move移动移动 (move)Transfer of ownership
Copy复制复制 (copy)Bitwise copy of data (for Copy types)
Clone克隆克隆 (clone)Deep copy operation
Scope作用域作用域 (scope)Range of code where variable is valid
Variable变量变量 (variable)Named storage location
Binding绑定绑定 (binding)Association between name and value
Expression表达式表达式 (expression)Code that evaluates to a value
Statement语句语句 (statement)Code that performs an action
Function函数函数 (function)Reusable code block
Method方法方法 (method)Function associated with type
Parameter参数参数 (parameter)Function input variable
Argument实参实参 (argument)Actual value passed to function

数据类型 (Data Types)

English中文First Use FormatNotes
Type类型类型 (type)Classification of data
Scalar标量标量 (scalar)Single value type
Compound复合复合 (compound)Multiple values type
Integer整数整数 (integer)Whole number type
Floating Point浮点数浮点数 (floating point)Decimal number type
Boolean布尔值布尔值 (boolean)true/false type
Character字符字符 (character)Single Unicode character
String字符串字符串 (string)Text type
Array数组数组 (array)Fixed-size collection
Slice切片切片 (slice)Dynamic view into collection
Tuple元组元组 (tuple)Fixed-size heterogeneous collection
Struct结构体结构体 (struct)Custom composite type
Enum枚举枚举 (enum)Type with named variants
Union联合体联合体 (union)Overlapping data representation
Option选项类型OptionType representing optional value
Result结果类型Result<T, E>Type representing success/error
Vector向量VecGrowable array
HashMap哈希映射HashMap<K, V>Key-value map
Box盒子BoxHeap pointer type
Rc引用计数RcReference-counted pointer
Arc原子引用计数ArcAtomic reference-counted pointer

特征与泛型 (Traits & Generics)

English中文First Use FormatNotes
Trait特征特征 (trait)Interface definition
Generic泛型泛型 (generic)Type parameterization
Type Parameter类型参数类型参数 (type parameter)Generic type placeholder
Implement实现实现 (implement)Provide trait definition
Inference推断推断 (inference)Automatic type deduction
Annotation注解注解 (annotation)Explicit type declaration
Constraint约束约束 (constraint)Generic type limitation
Bound边界边界 (bound)Trait requirement on generic
Default默认默认 (default)Fallback implementation
Derive派生派生 (derive)Automatic trait implementation
Macro宏 (macro)Code generation facility
Attribute属性属性 (attribute)Metadata annotation
Procedural Macro过程宏过程宏 (procedural macro)Compile-time code generation
Declarative Macro声明宏声明宏 (declarative macro)Pattern-based code generation

内存管理 (Memory Management)

English中文First Use FormatNotes
Stack栈 (stack)LIFO memory region
Heap堆 (heap)Dynamic memory region
Allocation分配分配 (allocation)Memory reservation
Deallocation释放释放 (deallocation)Memory return
Drop丢弃Drop traitResource cleanup trait
Destructor析构函数析构函数 (destructor)Cleanup function
Dangling悬垂悬垂指针 (dangling pointer)Invalid reference
Leak泄漏内存泄漏 (memory leak)Unreturned memory
Safe安全安全 (safe)Memory-safe operation
Unsafe不安全不安全 (unsafe)Requires manual safety proof

并发与异步 (Concurrency & Async)

English中文First Use FormatNotes
Concurrency并发并发 (concurrency)Multiple tasks in progress
Parallelism并行并行 (parallelism)Multiple tasks simultaneous
Thread线程线程 (thread)Execution unit
Async/Await异步/等待async/awaitAsynchronous programming model
Future未来值FutureAsync computation result
Executor执行器执行器 (executor)Async task scheduler
Runtime运行时运行时 (runtime)Execution environment
TokioTokioTokioAsync runtime crate
Mutex互斥锁MutexMutual exclusion primitive
RwLock读写锁RwLockRead-write lock
Channel通道通道 (channel)Message passing conduit
Send发送Send traitThread-safe transfer trait
Sync同步Sync traitThread-shared trait
Atomic原子操作原子操作 (atomic)Indivisible operation

错误处理 (Error Handling)

English中文First Use FormatNotes
Error错误错误 (error)Failure condition
Panic恐慌panic!Unrecoverable error
Unwind展开栈展开 (stack unwind)Stack cleanup on panic
Abort中止中止 (abort)Immediate termination
Expect预期expect()Unwrap with message
Unwrap解包unwrap()Extract value or panic
Match匹配matchPattern matching expression
Propagate传播传播 (propagate)Pass error to caller
Handle处理处理 (handle)Manage error condition
Recoverable可恢复可恢复错误 (recoverable error)Handled failure
Unrecoverable不可恢复不可恢复错误 (unrecoverable error)Fatal failure

工具与生态系统 (Tools & Ecosystem)

English中文First Use FormatNotes
CargoCargoCargoRust package manager
Crate箱 (crate)Compilation unit
Package包 (package)Distribution unit
Module模块模块 (module)Code organization unit
Workspace工作空间工作空间 (workspace)Multi-crate project
Dependency依赖依赖 (dependency)External crate requirement
Feature特性特性 (feature)Optional functionality
Build构建构建 (build)Compilation process
Test测试测试 (test)Verification process
Lint代码检查代码检查 (lint)Code quality check
ClippyClippyClippyRust linter tool
RustfmtRustfmtrustfmtCode formatter
Doc文档文档 (documentation)Generated documentation
Benchmark基准测试基准测试 (benchmark)Performance measurement
Profile性能分析性能分析 (profiling)Performance analysis

常用短语 (Common Phrases)

English中文Usage Context
Compile time编译时When code is compiled
Runtime运行时When code executes
Type safety类型安全Prevention of type errors
Memory safety内存安全Prevention of memory errors
Zero-cost abstraction零成本抽象No runtime overhead
Fearless concurrency无畏并发Safe concurrent programming
Data race数据竞争Concurrent memory access bug
Undefined behavior未定义行为Unpredictable program behavior
Borrow checker借用检查器Compiler ownership validator

Usage Guidelines

For Chapter Writers:

  1. First occurrence in chapter: Always use format 中文 (English)

    • ✅ Correct: "所有权 (ownership) 是 Rust 的核心概念"
    • ✅ Correct: "让我们了解 borrowing (借用) 的规则"
    • ❌ Wrong: "Ownership 是重要的" (English without translation)
    • ❌ Wrong: "所有权是重要的" (No English reference for searchability)
  2. Subsequent occurrences: Use Chinese only

    • ✅ "所有权系统确保..."
    • ✅ "借用规则防止..."
  3. Code examples: Keep English keywords

    • let x = 5; (not 让 X = 5;)
    • fn main() (not 函数 主 ())
  4. Links to external docs: Use English terms for URLs

    • ✅ Link to std::string::String (not std::字符串::字符串)

Glossary Maintenance:

  • Add new terms as discovered during chapter writing
  • Ensure all contributors use this single source of truth
  • Update if Rust community adopts new Chinese translations

References