Rust Official Glossary (CloudMonk.io)

Rust Official Glossary



Return to Glossary of Rust Programming Language Terms, Rust, Rust Glossary, Rust Docs

Rust Introduction:
* 1. Rust Notation

* 2. Rust Lexical structure
* 2.1. Rust Input format
* 2.2. Rust Keywords
* 2.3. Rust Identifiers
* 2.4. Rust Comments
* 2.5. Rust Whitespace
* 2.6. Rust Tokens

* 3. Rust Macros
* 3.1. Rust Macros By Example
* 3.2. Rust Procedural Macros

* 4. Rust Crates and source files

* 5. Rust Conditional compilation

* 6. Rust Items
* 6.1. Rust Modules
* 6.2. Rust Extern crates
* 6.3. Rust Use declarations
* 6.4. Rust Functions
* 6.5. Rust Type aliases
* 6.6. Rust Structs
* 6.7. Rust Enumerations
* 6.8. Rust Unions
* 6.9. Rust Constant items
* 6.10. Rust Static items
* 6.11. Rust Traits
* 6.12. Rust Implementations
* 6.13. Rust External blocks
* 6.14. Rust Generic parameters
* 6.15. Rust Associated Items

* 7. Rust Attributes
* 7.1. Rust Testing
* 7.2. Rust Derive
* 7.3. Rust Diagnostics
* 7.4. Rust Code generation
* 7.5. Rust Limits
* 7.6. Rust Type System
* 7.7. Rust Debugger

* 8. Rust Statements and expressions
* 8.1. Rust Statements
* 8.2. Rust Expressions
* 8.2.1. Rust Literal expressions
* 8.2.2. Rust Path expressions
* 8.2.3. Rust Block expressions
* 8.2.4. Rust Operator expressions
* 8.2.5. Rust Grouped expressions
* 8.2.6. Rust Array and index expressions
* 8.2.7. Rust Tuple and index expressions
* 8.2.8. Rust Struct expressions
* 8.2.9. Rust Call expressions
* 8.2.10. Rust Method call expressions
* 8.2.11. Rust Field access expressions
* 8.2.12. Rust Closure expressions
* 8.2.13. Rust Loop expressions
* 8.2.14. Rust Range expressions
* 8.2.15. Rust If and if let expressions
* 8.2.16. Rust Match expressions
* 8.2.17. Rust Return expressions
* 8.2.18. Rust Await expressions
* 8.2.19. Rust Underscore expressions

* 9. Rust Patterns

* 10. Rust Type system
* 10.1. Rust Types
* 10.1.1. Rust Boolean type
* 10.1.2. Rust Numeric types
* 10.1.3. Rust Textual types
* 10.1.4. Rust Never type
* 10.1.5. Rust Tuple types
* 10.1.6. Rust Array types
* 10.1.7. Rust Slice types
* 10.1.8. Rust Struct types
* 10.1.9. Rust Enumerated types
* 10.1.10. Rust Union types
* 10.1.11. Rust Function item types
* 10.1.12. Rust Closure types
* 10.1.13. Rust Pointer types
* 10.1.14. Rust Function pointer types
* 10.1.15. Rust Trait object types
* 10.1.16. Rust Impl trait type
* 10.1.17. Rust Type parameters
* 10.1.18. Rust Inferred type
* 10.2. Rust Dynamically Sized Types
* 10.3. Rust Type layout
* 10.4. Rust Interior mutability
* 10.5. Rust Subtyping and Variance
* 10.6. Rust Trait and lifetime bounds
* 10.7. Rust Type coercions
* 10.8. Rust Destructors
* 10.9. Rust Lifetime elision

* 11. Rust Special types and traits

* 12. Rust Names
* 12.1. Rust Namespaces
* 12.2. Rust Scopes
* 12.3. Rust Preludes
* 12.4. Rust Paths
* 12.5. Rust Name resolution
* 12.6. Rust Visibility and privacy

* 13. Rust Memory model
* 13.1. Rust Memory allocation and lifetime
* 13.2. Rust Variables

* 14. Rust Linkage

* 15. Rust Inline assembly

* 16. Rust Unsafety
* 16.1. Rust unsafe keyword
* 16.2. Rust Behavior considered undefined
* 16.3. Rust Behavior not considered unsafe

* 17. Rust Constant Evaluation

* 18. Rust Application Binary Interface

* 19. The Rust runtime

* 20. Rust Appendices
* 20.1. Rust Macro Follow-Set Ambiguity Formal Specification
* 20.2. Rust Influences
* 20.3. Rust Glossary


The Rust Reference


Rust Glossary

* Rust Abstract syntax tree - "An ‘abstract syntax tree’, or ‘AST’, is an intermediate representation of the structure of the program when the compiler is compiling it." (doc.rust-lang.org)

* Rust Alignment - "The alignment of a value specifies what addresses values are preferred to start at. Always a power of two. References to a value must be aligned. More.

* Rust Arity - "Arity refers to the number of arguments a function or operator takes. For some examples, f(2, 3) and g(4, 6) have arity 2, while h(8, 2, 6) has arity 3. The ! operator has arity 1.

* Rust Array - "An array, sometimes also called a fixed-size array or an inline array, is a value describing a collection of elements, each selected by an index that can be computed at run time by the program. It occupies a contiguous region of memory.

* Rust Associated item - "An associated item is an item that is associated with another item. Associated items are defined in implementations and declared in traits. Only functions, constants, and type aliases can be associated. Contrast to a free item.

* Rust Blanket implementation - "Any implementation where a type appears uncovered. impl Foo for T, impl Bar for T, impl Bar> for T, and impl Bar for Vec are considered blanket impls. However, impl Bar> for Vec is not a blanket impl, as all instances of T which appear in this impl are covered by Vec.

* Rust Bound - "Bounds are constraints on a type or trait. For example, if a bound is placed on the argument a function takes, types passed to that function must abide by that constraint.

* Rust Combinator - "Combinators are higher-order functions that apply only functions and earlier defined combinators to provide a result from its arguments. They can be used to manage control flow in a modular fashion.

* Rust Crate - "A crate is the unit of compilation and linking. There are different types of crates, such as libraries or executables. Crates may link and refer to other library crates, called external crates. A crate has a self-contained tree of modules, starting from an unnamed root module called the crate root. Items may be made visible to other crates by marking them as public in the crate root, including through paths of public modules. More.

* Rust Dispatch - "Dispatch is the mechanism to determine which specific version of code is actually run when it involves polymorphism. Two major forms of dispatch are static dispatch and dynamic dispatch. While Rust favors static dispatch, it also supports dynamic dispatch through a mechanism called ‘trait objects’.

* Rust Dynamically sized type - "A dynamically sized type (DST) is a type without a statically known size or alignment.

* Rust Entity - "An entity is a language construct that can be referred to in some way within the source program, usually via a path. Entities include types, items, generic parameters, variable bindings, loop labels, lifetimes, fields, attributes, and lints.

* Rust Expression - "An expression is a combination of values, constants, variables, operators and functions that evaluate to a single value, with or without side-effects.

For example, 2 + (3 * 4) is an expression that returns the value 14.

* Rust Free item - "An item that is not a member of an implementation, such as a free function or a free const. Contrast to an associated item.

* Rust Fundamental traits - "A fundamental trait is one where adding an impl of it for an existing type is a breaking change. The Fn traits and Sized are fundamental.

* Rust Fundamental type constructors - "A fundamental type constructor is a type where implementing a blanket implementation over it is a breaking change. &, &mut, Box, and Pin are fundamental.

Any time a type T is considered local, &T, &mut T, Box, and Pin are also considered local. Fundamental type constructors cannot cover other types. Any time the term "covered type" is used, the T in &T, &mut T, Box, and Pin is not considered covered.

* Rust Inhabited - "A type is inhabited if it has constructors and therefore can be instantiated. An inhabited type is not "empty" in the sense that there can be values of the type. Opposite of Uninhabited.

* Rust Inherent implementation - "An implementation that applies to a nominal type, not to a trait-type pair. More.

* Rust Inherent method - "A method defined in an inherent implementation, not in a trait implementation.

* Rust Initialized - "A variable is initialized if it has been assigned a value and hasn't since been moved from. All other memory locations are assumed to be uninitialized. Only unsafe Rust can create a memory location without initializing it.

* Rust Local trait - "A trait which was defined in the current crate. A trait definition is local or not independent of applied type arguments. Given trait Foo, Foo is always local, regardless of the types substituted for T and U.

* Rust Local type - "A struct, enum, or union which was defined in the current crate. This is not affected by applied type arguments. struct Foo is considered local, but Vec is not. LocalType is local. Type aliases do not affect locality.

* Rust Module - "A module is a container for zero or more items. Modules are organized in a tree, starting from an unnamed module at the root called the crate root or the root module. Paths may be used to refer to items from other modules, which may be restricted by visibility rules. More

* Rust Name - "A name is an identifier or lifetime or loop label that refers to an entity. A name binding is when an entity declaration introduces an identifier or label associated with that entity. Paths, identifiers, and labels are used to refer to an entity.

* Rust Name resolution - "Name resolution is the compile-time process of tying paths, identifiers, and labels to entity declarations.

* Rust Namespace - "A namespace is a logical grouping of declared names based on the kind of entity the name refers to. Namespaces allow the occurrence of a name in one namespace to not conflict with the same name in another namespace.

Within a namespace, names are organized in a hierarchy, where each level of the hierarchy has its own collection of named entities.

* Rust Nominal types - "Types that can be referred to by a path directly. Specifically enums, structs, unions, and trait objects.

* Rust Object safe traits - "Traits that can be used as trait objects. Only traits that follow specific rules are object safe.

* Rust Path - "A path is a sequence of one or more path segments used to refer to an entity in the current scope or other levels of a namespace hierarchy.

* Rust Prelude - "Prelude, or The Rust Prelude, is a small collection of items - mostly traits - that are imported into every module of every crate. The traits in the prelude are pervasive.

* Rust Scope - "A scope is the region of source text where a named entity may be referenced with that name.

* Rust Scrutinee - "A scrutinee is the expression that is matched on in match expressions and similar pattern matching constructs. For example, in match x { A => 1, B => 2 }, the expression x is the scrutinee.

* Rust Size - "The size of a value has two definitions.

The first is that it is how much memory must be allocated to store that value.

The second is that it is the offset in bytes between successive elements in an array with that item type.

It is a multiple of the alignment, including zero. The size can change depending on compiler version (as new optimizations are made) and target platform (similar to how usize varies per-platform).

More.

* Rust Slice - "A slice is dynamically-sized view into a contiguous sequence, written as [T].

It is often seen in its borrowed forms, either mutable or shared. The shared slice type is &[T], while the mutable slice type is &mut [T], where T represents the element type.

* Rust Statement - "A statement is the smallest standalone element of a programming language that commands a computer to perform an action.

* Rust String literal - "A string literal is a string stored directly in the final binary, and so will be valid for the 'static duration.

Its type is 'static duration borrowed string slice, &'static str.

* Rust String slice - "A string slice is the most primitive string type in Rust, written as str. It is often seen in its borrowed forms, either mutable or shared. The shared string slice type is &str, while the mutable string slice type is &mut str.

Strings slices are always valid UTF-8.

* Rust Trait - "A trait is a language item that is used for describing the functionalities a type must provide. It allows a type to make certain promises about its behavior.

Generic functions and generic structs can use traits to constrain, or bound, the types they accept.

* Rust Turbofish - "Paths with generic parameters in expressions must prefix the opening brackets with a ::. Combined with the angular brackets for generics, this looks like a fish ::<>. As such, this syntax is colloquially referred to as turbofish syntax.

Examples:

let ok_num = Ok::<_, ()>(5);
let vec = [1, 2, 3].iter().map(|n| n * 2).collect::>();
This :: prefix is required to disambiguate generic paths with multiple comparisons in a comma-separate list. See the bastion of the turbofish for an example where not having the prefix would be ambiguous.

* Rust Uncovered type - "A type which does not appear as an argument to another type. For example, T is uncovered, but the T in Vec is covered. This is only relevant for type arguments.

* Rust Undefined behavior - "Compile-time or run-time behavior that is not specified. This may result in, but is not limited to: process termination or corruption; improper, incorrect, or unintended computation; or platform-specific results. More.

* Rust Uninhabited - "A type is uninhabited if it has no constructors and therefore can never be instantiated. An uninhabited type is "empty" in the sense that there are no values of the type. The canonical example of an uninhabited type is the never type !, or an enum with no variants enum Never { }. Opposite of Inhabited."





Fair Use Sources


Fair Use Sources:
* https://doc.rust-lang.org/reference/glossary.html

Rust: Rust Best Practices, Rust Anti-Patterns, Rust Fundamentals, Rust Inventor: Rust Language Designer: Graydon Hoare on July 7, 2010; Cloud Native Rust https://CloudRust.rs, Rust Wasm - Rust WebAssembly https://WebAssembly.rs, Rust in the Cloud https://CloudRust.io, Rust RFCs https://github.com/rust-lang/rfcs, Rust Scripting, Rust Keywords, Rust Built-In Data Types, Rust Data Structures - Rust Algorithms, Rust Syntax, Rust OOP - Rust Design Patterns https://DesignPatterns.rs https://rust-unofficial.github.io/patterns/rust-design-patterns.pdf, Rust Package Manager (cargo-crates.io - Rust Crates - Rust Cargo), Rust Virtualization, Rust Interpreter, Rust REPL, Rust IDEs (JetBrains RustRover, IntelliJ - CLion with JetBrains Rust Plugins, Visual Studio Code), Rust Development Tools, Rust Linter, Rustaceans https://Rustaceans.rs Rust Users - Rust Programmers, List of Rust Software, Rust Popularity, Rust Compiler (rustc), Rust Transpiler, Rust DevOps - Rust SRE, Rust Data Science - Rust DataOps, Rust Machine Learning, Rust Deep Learning, Functional Rust , Rust Concurrency - Rust Parallel Programming - Async Rust, Rust Standard Library, Rust Testing, Rust Libraries, Rust Frameworks, Rust History, Rust Bibliography, Manning Rust Series, Rust Glossary - Rust Official Glossary - Glossaire de Rust - French, Rust Topics, Rust Courses, Rust Research, Rust GitHub, Written in Rust, Rust Awesome List. (navbar_rust - see also navbar_rust_domains)



----



Cloud Monk is Retired (impermanence |for now). Buddha with you. Copyright | © Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers



SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.



----