Training > Web & Application Development > Programming in Rust (LFD480)
INSTRUCTOR-LED COURSE

Programming in Rust (LFD480)

In this instructor-led course, you’ll obtain a solid understanding of idiomatic Rust and improve your developer productivity.

Who Is It For

This course is designed for system and application programmers interested in learning the Rust language.
read less read more
What You’ll Learn

This course teaches you to program in idiomatic Rust, applying concepts like ownership, borrowing and lifetimes; primitive and complex types; std collection; error handling; testing programs; profiling programs; concurrency; smart pointers; using C code with FFI; using Rust with containers and Kubernetes; and deployment on multiple architectures (AMD64, ARM64, RISCV64).
read less read more
What It Prepares You For

This course enables you to become a confident developer in the Rust programming language. You will be able to write small system programs using OS functions; single web page applications; API clients and servers; and programs that use Rust's concurrency features. Leveraging the rich Rust ecosystem, modules and tools, you will be able to start your own projects and engage with existing ones.
read less read more
Course Outline
Expand All
Collapse All
Introduction
- The Linux Foundation{
- The Linux Foundation{ Training
- The Linux Foundation{ Certifications
- The Linux Foundation{ Digital Badges
- Laboratory Exercises, Solutions and Resources
- Things Change in Linux and Open Source Projects
- Distribution Details
- Labs
Preliminaries
- Labs
Introduction to Rust
- History of Rust
- Popularity of Rust
- Programmed in Rust
- Philosophy behind Rust
- Why not Rust
- Rust as your first programming language
- Rust and Software Engineering
- Rust release cycle
- Rust's Release Timeline
- Rust REPL
- Install and configure your Rust environment
- Anatomy of a Rust program
- Using cargo
- Adventurous Rust
- Labs
My 1st Rust program
- Variables
- Constants
- Ownership & Borrowing
- The Three Ownership Rules
- Primitive Types with Copy Trait
- Rust is an expression language
- Primitive datatypes
- Strings & Str
- Object or Owned Strings
- Understanding String Slices
- Arrays
- Labs
Program flow
- Introduction to Conditionals
- Conditionals - if
- Conditionals - match
- Match Expressions in Rust
- Loops
- Rust Loops
- The While Loop
- Using Break and Continue in a For Loop
- Labs
Complex data types
- Tuples
- Structs
- Enums
- Vectors
- HashMaps
- Creating and Initializing a HashMap
- Conclusion
- Methods of Accessing Data in HashMaps
- Best Practices and Use Cases
- HashMap Iteration Order
- Removing Data by Key
- Labs
Functions in Rust
- functions
- Labs
Error handling in Rust
- Panic
- Example of Handling a Non-recoverable Error
- Advanced (pattern-)matching
- Why Use Closures with texttt {unwrap_or_else
- Pros and Cons of Using texttt {unwrap
- Use Cases and Tips for texttt {unwrap
- Upstream error handling
- Improvements of the new versus the old version
- Labs
Testing in Rust
- Testing in Rust
- Unit testing
- Doc testing
- Integration testing
- Labs
Debugging in Rust
- Debugging in Rust
- Labs
Object Oriented Programming in Rust
- OOP in Rust
- Structs and methods
- Composition over Inheritance
- Encapsulation
- Traits
- Generics - static dispatch
- The Problem Generics Solve
- Object Traits - dynamic dispatch
- Labs
Closures
- Introduction to closures
- Labs
Iterators
- Iterators
- Tips for Using Iterators in Rust
- Summing Elements with an Iterator
- Understanding Iterator Consumers
- Applying Transformations with Map
- Labs
Lifetimes
- Lifetimes
- Labs
Crates
- Code organization in Rust
- Crates in Rust
- File Structure
- Examples
- Tips for Working with Crates
- Programming in the large with Rust
- File Structure
- Labs
OS functions
- ENV vars
- File I/O
- Adding inotify to Cargo.toml
- Processes
- Labs
Benchmarking and Profiling Rust programs
- Benchmarking
- Profiling
- Labs
Smart Pointers
- Box
- The Role of texttt {Box in Recursive Structures
- Rc and Arc
- Cell and RefCell
- Mutex and RwLock
- Labs
Concurrency in Rust
- Concurrency
- Rust's Approach to Concurrency
- Threads in Rust
- Message Passing
- Shared State Concurrency
- Atomic Operations
- Asynchronous Programming in Rust
- Conclusion
- Labs
Using Rust in containers
- Building rust in Podman containers
- Labs
Cross compiling in Rust
- Setting up Rust for cross-compiling
- Labs
Advanced Topics
- Foreign Function Interface
- Unsafe Rust
- Labs
Closing and Evaluation Survey
- Evaluation Survey

Prerequisites
Learners must have programming experience in another program language like C/C++, Java, JavaScript or Go.

Labs can be prepared and run on x86_64, ARM64 and RISCV64 systems. You should have at least 4GiB of RAM and 50GiB of free space. For the labs using containers and/or Kubernetes more RAM is advisable.

Reviews
Nov 2024
The course material (slides with explanations and examples, and lab exercises) was very good, and well organized.
Aug 2024
The course content was very well organized.
Aug 2024
It provided a good holistic introduction to Rust, and filled in a number of gaps in my knowledge.
Aug 2024
I liked the interactive nature, whereby we would ask a question, and then explore it as a group until satisfactorily seeing/experiencing the result.
Aug 2024
I really liked the detail and practice of Rust idioms.