2023-10-05 07:17:24 +02:00
|
|
|
# Glossary
|
|
|
|
|
|
|
|
The following is a glossary which aims to give a short definition of many Rust
|
|
|
|
terms. For translations, this also serves to connect the term back to the
|
|
|
|
English original.
|
|
|
|
|
2023-10-06 14:26:52 +02:00
|
|
|
<style>
|
|
|
|
h1#glossary ~ ul {
|
|
|
|
list-style: none;
|
|
|
|
padding-inline-start: 0;
|
|
|
|
}
|
2023-10-05 07:17:24 +02:00
|
|
|
|
2023-10-06 14:26:52 +02:00
|
|
|
h1#glossary ~ ul > li {
|
|
|
|
/* Simplify with "text-indent: 2em hanging" when supported:
|
|
|
|
https://caniuse.com/mdn-css_properties_text-indent_hanging */
|
|
|
|
padding-left: 2em;
|
|
|
|
text-indent: -2em;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1#glossary ~ ul > li:first-line {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Translators: please add the English term in italic after your translated term.
|
|
|
|
Also, please keep the hard line breaks to ensure a nice formatting.
|
|
|
|
-->
|
|
|
|
|
|
|
|
- allocate:\
|
|
|
|
Dynamic memory allocation on [the heap](memory-management/stack-vs-heap.md).
|
|
|
|
- argument:\
|
2023-11-15 14:53:51 +05:30
|
|
|
Information that is passed into a function or method.
|
2023-10-09 11:29:14 +02:00
|
|
|
- Bare-metal Rust:\
|
|
|
|
Low-level Rust development, often deployed to a system without an operating
|
|
|
|
system. See [Bare-metal Rust](bare-metal.md).
|
2023-10-06 14:26:52 +02:00
|
|
|
- block:\
|
|
|
|
See [Blocks](control-flow/blocks.md) and _scope_.
|
|
|
|
- borrow:\
|
|
|
|
See [Borrowing](ownership/borrowing.md).
|
|
|
|
- borrow checker:\
|
|
|
|
The part of the Rust compiler which checks that all borrows are valid.
|
|
|
|
- brace:\
|
|
|
|
`{` and `}`. Also called _curly brace_, they delimit _blocks_.
|
|
|
|
- build:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The process of converting source code into executable code or a usable
|
|
|
|
program.
|
2023-10-06 14:26:52 +02:00
|
|
|
- call:\
|
2023-11-15 14:53:51 +05:30
|
|
|
To invoke or execute a function or method.
|
2023-10-06 14:26:52 +02:00
|
|
|
- channel:\
|
|
|
|
Used to safely pass messages [between threads](concurrency/channels.md).
|
|
|
|
- Comprehensive Rust 🦀:\
|
|
|
|
The courses here are jointly called Comprehensive Rust 🦀.
|
|
|
|
- concurrency:\
|
2023-11-15 14:53:51 +05:30
|
|
|
The execution of multiple tasks or processes at the same time.
|
2023-10-06 14:26:52 +02:00
|
|
|
- Concurrency in Rust:\
|
|
|
|
See [Concurrency in Rust](concurrency.md).
|
|
|
|
- constant:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A value that does not change during the execution of a program.
|
2023-10-06 14:26:52 +02:00
|
|
|
- control flow:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The order in which the individual statements or instructions are executed in a
|
|
|
|
program.
|
2023-10-06 14:26:52 +02:00
|
|
|
- crash:\
|
2023-11-15 14:53:51 +05:30
|
|
|
An unexpected and unhandled failure or termination of a program.
|
2023-10-06 14:26:52 +02:00
|
|
|
- enumeration:\
|
2024-01-12 06:52:26 -08:00
|
|
|
A data type that holds one of several named constants, possibly with an
|
|
|
|
associated tuple or struct.
|
2023-10-06 14:26:52 +02:00
|
|
|
- error:\
|
2023-11-15 14:53:51 +05:30
|
|
|
An unexpected condition or result that deviates from the expected behavior.
|
2023-10-06 14:26:52 +02:00
|
|
|
- error handling:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The process of managing and responding to errors that occur during program
|
|
|
|
execution.
|
2023-10-06 14:26:52 +02:00
|
|
|
- exercise:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A task or problem designed to practice and test programming skills.
|
2023-10-06 14:26:52 +02:00
|
|
|
- function:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A reusable block of code that performs a specific task.
|
2023-10-06 14:26:52 +02:00
|
|
|
- garbage collector:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A mechanism that automatically frees up memory occupied by objects that are no
|
|
|
|
longer in use.
|
2023-10-06 14:26:52 +02:00
|
|
|
- generics:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A feature that allows writing code with placeholders for types, enabling code
|
|
|
|
reuse with different data types.
|
2023-10-06 14:26:52 +02:00
|
|
|
- immutable:\
|
2023-11-15 14:53:51 +05:30
|
|
|
Unable to be changed after creation.
|
2023-10-06 14:26:52 +02:00
|
|
|
- integration test:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A type of test that verifies the interactions between different parts or
|
|
|
|
components of a system.
|
2023-10-06 14:26:52 +02:00
|
|
|
- keyword:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A reserved word in a programming language that has a specific meaning and
|
|
|
|
cannot be used as an identifier.
|
2023-10-06 14:26:52 +02:00
|
|
|
- library:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A collection of precompiled routines or code that can be used by programs.
|
2023-10-06 14:26:52 +02:00
|
|
|
- macro:\
|
2023-12-31 00:15:07 +01:00
|
|
|
Rust macros can be recognized by a `!` in the name. Macros are used when
|
|
|
|
normal functions are not enough. A typical example is `format!`, which takes a
|
|
|
|
variable number of arguments, which isn't supported by Rust functions.
|
2023-11-10 15:15:32 +01:00
|
|
|
- `main` function:\
|
|
|
|
Rust programs start executing with the `main` function.
|
2023-10-06 14:26:52 +02:00
|
|
|
- match:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A control flow construct in Rust that allows for pattern matching on the value
|
|
|
|
of an expression.
|
2023-10-06 14:26:52 +02:00
|
|
|
- memory leak:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A situation where a program fails to release memory that is no longer needed,
|
|
|
|
leading to a gradual increase in memory usage.
|
2023-10-06 14:26:52 +02:00
|
|
|
- method:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A function associated with an object or a type in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- module:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A namespace that contains definitions, such as functions, types, or traits, to
|
|
|
|
organize code in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- move:\
|
2023-11-15 14:53:51 +05:30
|
|
|
The transfer of ownership of a value from one variable to another in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- mutable:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A property in Rust that allows variables to be modified after they have been
|
|
|
|
declared.
|
2023-10-06 14:26:52 +02:00
|
|
|
- ownership:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The concept in Rust that defines which part of the code is responsible for
|
|
|
|
managing the memory associated with a value.
|
2023-10-06 14:26:52 +02:00
|
|
|
- panic:\
|
2023-12-31 00:15:07 +01:00
|
|
|
An unrecoverable error condition in Rust that results in the termination of
|
|
|
|
the program.
|
2023-10-06 14:26:52 +02:00
|
|
|
- parameter:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A value that is passed into a function or method when it is called.
|
2023-10-06 14:26:52 +02:00
|
|
|
- pattern:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A combination of values, literals, or structures that can be matched against
|
|
|
|
an expression in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- payload:\
|
2023-11-15 14:53:51 +05:30
|
|
|
The data or information carried by a message, event, or data structure.
|
2023-10-06 14:26:52 +02:00
|
|
|
- program:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A set of instructions that a computer can execute to perform a specific task
|
|
|
|
or solve a particular problem.
|
2023-10-06 14:26:52 +02:00
|
|
|
- programming language:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A formal system used to communicate instructions to a computer, such as Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- receiver:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The first parameter in a Rust method that represents the instance on which the
|
|
|
|
method is called.
|
2023-10-06 14:26:52 +02:00
|
|
|
- reference counting:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A memory management technique in which the number of references to an object
|
|
|
|
is tracked, and the object is deallocated when the count reaches zero.
|
2023-10-06 14:26:52 +02:00
|
|
|
- return:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A keyword in Rust used to indicate the value to be returned from a function.
|
2023-10-06 14:26:52 +02:00
|
|
|
- Rust:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A systems programming language that focuses on safety, performance, and
|
|
|
|
concurrency.
|
2023-10-06 14:26:52 +02:00
|
|
|
- Rust Fundamentals:\
|
|
|
|
Days 1 to 3 of this course.
|
|
|
|
- Rust in Android:\
|
|
|
|
See [Rust in Android](android.md).
|
2023-11-27 18:21:19 +00:00
|
|
|
- Rust in Chromium:\
|
|
|
|
See [Rust in Chromium](chromium.md).
|
2023-10-06 14:26:52 +02:00
|
|
|
- safe:\
|
2023-12-31 00:15:07 +01:00
|
|
|
Refers to code that adheres to Rust's ownership and borrowing rules,
|
|
|
|
preventing memory-related errors.
|
2023-10-06 14:26:52 +02:00
|
|
|
- scope:\
|
2023-11-15 14:53:51 +05:30
|
|
|
The region of a program where a variable is valid and can be used.
|
2023-10-06 14:26:52 +02:00
|
|
|
- standard library:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A collection of modules providing essential functionality in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- static:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A keyword in Rust used to define static variables or items with a `'static`
|
|
|
|
lifetime.
|
2023-10-06 14:26:52 +02:00
|
|
|
- string:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A data type storing textual data. See
|
|
|
|
[`String` vs `str`](basic-syntax/string-slices.html) for more.
|
2023-10-06 14:26:52 +02:00
|
|
|
- struct:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A composite data type in Rust that groups together variables of different
|
|
|
|
types under a single name.
|
2023-10-06 14:26:52 +02:00
|
|
|
- test:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A Rust module containing functions that test the correctness of other
|
|
|
|
functions.
|
2023-10-06 14:26:52 +02:00
|
|
|
- thread:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A separate sequence of execution in a program, allowing concurrent execution.
|
2023-10-06 14:26:52 +02:00
|
|
|
- thread safety:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The property of a program that ensures correct behavior in a multithreaded
|
|
|
|
environment.
|
2023-10-06 14:26:52 +02:00
|
|
|
- trait:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A collection of methods defined for an unknown type, providing a way to
|
|
|
|
achieve polymorphism in Rust.
|
2023-12-11 01:05:11 +09:00
|
|
|
- trait bound:\
|
2023-12-31 00:15:07 +01:00
|
|
|
An abstraction where you can require types to implement some traits of your
|
|
|
|
interest.
|
2024-01-12 06:52:26 -08:00
|
|
|
- tuple:\
|
|
|
|
A composite data type that contains variables of different types. Tuple fields
|
|
|
|
have no names, and are accessed by their ordinal numbers.
|
2023-10-06 14:26:52 +02:00
|
|
|
- type:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A classification that specifies which operations can be performed on values of
|
|
|
|
a particular kind in Rust.
|
2023-10-06 14:26:52 +02:00
|
|
|
- type inference:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The ability of the Rust compiler to deduce the type of a variable or
|
|
|
|
expression.
|
2023-10-06 14:26:52 +02:00
|
|
|
- undefined behavior:\
|
2023-12-31 00:15:07 +01:00
|
|
|
Actions or conditions in Rust that have no specified result, often leading to
|
|
|
|
unpredictable program behavior.
|
2023-10-06 14:26:52 +02:00
|
|
|
- union:\
|
2023-11-15 14:53:51 +05:30
|
|
|
A data type that can hold values of different types but only one at a time.
|
2023-10-06 14:26:52 +02:00
|
|
|
- unit test:\
|
2023-11-10 15:15:32 +01:00
|
|
|
Rust comes with built-in support for running small unit tests and larger
|
|
|
|
integration tests. See [Unit Tests](testing/unit-tests.html).
|
2024-01-12 06:52:26 -08:00
|
|
|
- unit type:\
|
|
|
|
Type that holds no data, written as a tuple with no members.
|
2023-10-06 14:26:52 +02:00
|
|
|
- unsafe:\
|
2023-12-31 00:15:07 +01:00
|
|
|
The subset of Rust which allows you to trigger _undefined behavior_. See
|
|
|
|
[Unsafe Rust](unsafe.html).
|
2023-10-06 14:26:52 +02:00
|
|
|
- variable:\
|
2023-12-31 00:15:07 +01:00
|
|
|
A memory location storing data. Variables are valid in a _scope_.
|