Basic Concepts & Syntax
Basic Concepts & Syntax covers Rust’s first-layer language mechanics: bindings, primitive data, functions, expressions, control flow, and comments.
Concepts
- Variables and Mutability
- Shadowing
- Constants
- Static Items
- Scalar Types
- Boolean Logic
- Integer Overflow
- Type Inference
- Tuples
- Arrays
- Functions
- Generic Functions
- Name Resolution
- Statements vs Expressions
- Control Flow
- If Expressions
- Loop Expressions
- While and For Loops
- Iterator Method Trio
- Comments
- The Display Trait
- The Debug Trait
- PartialEq
- UnsafeCell
- Build-Time Code Execution
- Private Fields with Public Constructors
- Readable Generic APIs
Patterns
Antipatterns
See also
Ownership · Borrowing · Pattern Matching · Slices · Vectors · Result · Testing
Sources
- The Rust Programming Language, ch. 3 “Common Programming Concepts” — the-book, https://doc.rust-lang.org/book/ch03-00-common-programming-concepts.html
- The Rust Reference, “Types” — the-reference, https://doc.rust-lang.org/reference/types.html
- The Rust Reference, “Statements and expressions” — the-reference, https://doc.rust-lang.org/reference/statements-and-expressions.html
