Rust Essential Training
6h 48mBeginner2021-12-02
Authors

Barron Stone
Electrical Engineer
Course details
If you know even a little bit about programming languages, you know there are a plethora of options to choose from. If your priority is a language focused on reliability, speed, memory, safety, and parallelism, then Rust may be the one for you. In this course, instructor Barron Stone covers the key components of Rust, starting with basic programming concepts including variables, data types, functions, and control loops. He then moves on to some of the core concepts that are unique to Rust, including ownership, borrowing references, and crates. While Rust is great for low-level systems programming, it’s also being used for web apps, network services, and embedded programs. As Barron shows, the features of Rust, along with great tools, documentation, and a welcoming community, have made Rust a language that developers love.
Skills covered
RustEssential TrainingProgramming LanguagesOpen SourceSoftware Development
Concepts
Introduction
- Learn Rust programming
- What you should know
- What is Rust
- Rust versions
Write Your First Program
- Installing Rust on Windows
- Installing Rust on Linux and macOS
- Anatomy of a Rust program
- Adding comments
- Building programs using Cargo
Primitive Data Types
- Declaring variables
- Integer data types
- Floating-point data types
- Arithmetic operations
- Formatting print statements
- Bitwise operations
- Boolean data type and operations
- Comparison operations
- Char data types
- Challenge - Find the average
- Solution - Find the average
Compound Data Types
- Arrays
- Multidimensional arrays
- Tuples
Functions
- Function parameters
- Statements vs. expressions
- Function return values
- Challenge - Convert temperature
- Solution - Convert temperature
Program Flow Control
- Conditional execution
- Multiple conditions
- Conditional assignment
- Loops
- While loops
- For loops
- Nested loops
- Challenge - Max, min, mean
- Solution - Max, min, mean
Ownership
- Variable scope
- Shadowing variables
- Stack and heap memory
- String data type
- Ownership
- Moving, cloning, and copying data
- Transferring ownership
References
- Borrowing references
- Mutable references
- Dangling references
- Slices
- Slices as function parameters
- Challenge - Trim spaces
- Solution - Trim spaces
Modules
- Rust Standard Library and prelude
- Standard input
- Parse strings
- Crates
- Challenge - Higher or lower
- Solution - Higher or lower
Input and Output
- Command-line arguments
- Reading from files
- Writing to files
- Challenge - Check the roster
- Solution - Check the roster
Structs
- Defining structs
- Struct update syntax
- Struct methods
- Associated functions
- Tuple structs
- Challenge - Represent shapes
- Solution - Represent shapes
Generic Types
- Generic struct definitions
- Generic method definitions
- Generic function definitions
- Box data type
- Challenge - Sum boxes
- Solution - Sum boxes
Traits
- Implement traits
- Default trait implementation
- Derive traits
- Trait bounds
- Multiple trait bounds
- Return types with implemented traits
- Challenge - Implement the display trait
- Solution - Implement the display trait
Lifetimes
- The borrow checker
- Lifetime annotation syntax
- Multiple lifetime annotations
- Lifetime elision rules
- Struct lifetime annotations
- Static lifetime
Enums
- Define enums
- Match operator
- Match with default placeholder
- Enum methods
- Option T enum
- Matching Option T
- If-let syntax
- Challenge - Represent a location
- Solution - Represent a location
Error Handling
- Result T, E enum
- Matching Result T, E to recover from errors
- Propagating errors
- Challenge - Handle errors
- Solution - Handle errors
- Unrecoverable errors
Collections
- Vectors
- HashMaps
- Challenge - Count words
- Solution - Count words
Conclusion
- Where to go next