1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-12-22 22:51:12 +02:00

Add glossary entries for Day 1 (#2953)

These Rust-specific entries are for concepts taught on Day 1 and could
thus be useful to have in the glossary.
This commit is contained in:
Martin Geisler
2025-10-30 10:39:12 +01:00
committed by GitHub
parent 4d8bfaa55e
commit 398cdb475f

View File

@@ -30,6 +30,9 @@ h1#glossary ~ ul > li:first-line {
- allocate:\ - allocate:\
Dynamic memory allocation on [the heap](memory-management/review.md). Dynamic memory allocation on [the heap](memory-management/review.md).
- array:\
A fixed-size collection of elements of the same type, stored contiguously in
memory. See [Arrays](tuples-and-arrays/arrays.md).
- associated type:\ - associated type:\
A type associated with a specific trait. Useful for defining the relationship A type associated with a specific trait. Useful for defining the relationship
between types. between types.
@@ -130,6 +133,10 @@ h1#glossary ~ ul > li:first-line {
- receiver:\ - receiver:\
The first parameter in a Rust [method](methods-and-traits/methods.md) that The first parameter in a Rust [method](methods-and-traits/methods.md) that
represents the instance on which the method is called. represents the instance on which the method is called.
- reference:\
A non-owning pointer to a value that borrows it without transferring
ownership. References can be [shared (immutable)](references/shared.md) or
[exclusive (mutable)](references/exclusive.md).
- reference counting:\ - reference counting:\
A memory management technique in which the number of references to an object 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. See is tracked, and the object is deallocated when the count reaches zero. See
@@ -140,6 +147,10 @@ h1#glossary ~ ul > li:first-line {
- safe:\ - safe:\
Refers to code that adheres to Rust's ownership and borrowing rules, Refers to code that adheres to Rust's ownership and borrowing rules,
preventing memory-related errors. See [Unsafe Rust](unsafe-rust.md). preventing memory-related errors. See [Unsafe Rust](unsafe-rust.md).
- slice:\
A dynamically-sized view into a contiguous sequence, such as an array or
vector. Unlike arrays, slices have a size determined at runtime. See
[Slices](references/slices.md).
- scope:\ - scope:\
The region of a program where a variable is valid and can be used. See The region of a program where a variable is valid and can be used. See
[Blocks and Scopes](control-flow-basics/blocks-and-scopes.md). [Blocks and Scopes](control-flow-basics/blocks-and-scopes.md).