About the course
Welcome to Rust, a modern systems programming language that's changing the way we think about software development. Unlike many other languages, Rust gives you the power of a low-level language without sacrificing safety or ease of use. It's a game-changer for building lightning-fast, rock-solid applications that are less prone to crashes and bugs.
This four-day, hands-on course is your gateway to the world of Rust. We'll start with the basics - getting your development environment set up and writing your very first lines of code. You’ll learn the core syntax and build a strong foundation, setting the stage for understanding Rust's most exciting feature: its unique ownership system. This powerful concept prevents common programming errors before your code ever runs, ensuring memory safety and freeing you from the burdens of manual memory management.
Beyond the fundamentals, we'll dive into advanced topics that prepare you for real-world projects. You'll learn how to structure data, handle errors gracefully, and manage large codebases. We'll also explore the secrets to Rust's blazing performance and its elegant approach to concurrency, empowering you to write efficient, multi-threaded applications with confidence. By the end of this course, you’ll be equipped to build robust, high-performance software for everything from web services to embedded systems.
Instructor-led online and in-house face-to-face options are available - as part of a wider customised training programme, or as a standalone workshop, on-site at your offices or at one of many flexible meeting spaces in the UK and around the World.
-
- Explain Rust's purpose, key features, and philosophy, and set up a Rust development environment.
- Understand and utilise basic Rust syntax, fundamental data types, functions, and control flow constructs.
- Explain and effectively apply Rust's Ownership system, including the concepts of Borrowing and Slices, to ensure memory safety.
- Structure data effectively using Structs and Enums and apply Pattern Matching with the match operator.
- Manage Rust project structure using Packages, Crates, and Modules, controlling scope and privacy.
- Work with essential Rust Collections like Vectors and Hash Maps.
- Implement robust Error Handling using the panic! macro and the Result type.
- Understand and use Generics, Traits, and Lifetimes for writing flexible, reusable, and safe code.
- Gain an introduction to Smart Pointers and implement basic Concurrency with threads and message passing.
- Understand Object-Oriented and Functional Programming perspectives and how they apply in idiomatic Rust.
- Write and run basic Unit Tests for Rust code.
-
This hands-on training course is designed for experienced programmers who want to learn the Rust programming language for building reliable, performant, and memory-safe software. It is ideal for:
Systems Programmers interested in a modern language for operating systems, embedded systems, device drivers, or high-performance computing.
Developers from languages like C, C++, or Go looking for enhanced memory safety and concurrency features without the complexities of manual memory management or the overhead of a garbage collector.
Developers interested in performance-oriented programming and gaining a deeper understanding of low-level concepts.
Anyone building command-line tools, network services, web assembly modules, or other applications where performance, reliability, and resource control are critical.
-
Participants should have:
Prior programming experience in at least one other language such as Java, C++, JavaScript, or C#.
Familiarity with basic programming concepts like variables, data types, functions, control flow, and ideally some understanding of concepts like pointers or memory management (though the course will cover Rust's approach in detail).
We can customise the training to match your team's experience and needs - with more time and coverage of programming / system fundamentals for new developers, for instance.
-
This Rust course is available for private / custom delivery for your team - as an in-house face-to-face workshop at your location of choice, or as online instructor-led training via MS Teams (or your own preferred platform).
Get in touch to find out how we can deliver tailored training which focuses on your project requirements and learning goals.
-
Introduction to Rust
What is Rust? Philosophy, goals, and key features.
Use cases for Rust (systems programming, web assembly, CLI tools, etc.).
Language fundamentals overview.
Obtaining Rust: Using rustup to install the Rust toolchain.
Setting up your development environment (code editor, extensions).
Compiling and running your first Rust program (cargo new, cargo build, cargo run).
Using Useful Online Resources (The Book, Rust by Example, Crates.io).
Hands-On Lab: Installing Rust, setting up the environment, compiling and running a "Hello, world!" program.
Getting Started with Rust
Variables: Declaring variables with let.
Mutability: Using mut.
Constants.
Shadowing variables.
Data Types: Scalar types (Integers, Floating-Point Numbers, Booleans, Characters) and Compound types (Tuples, Arrays).
Functions: Defining functions, parameters, return types.
Comments.
Control Flow: if, else if, else expressions.
Loops: loop, while, for.
Expressions: Statements vs. Expressions.
Hands-On Lab: Writing programs using variables, basic data types, functions, conditionals, and loops.
Rust Ownership Fundamentals
What is Ownership?: The core concept for memory safety without a GC.
Rules of Ownership.
Memory safety principles in Rust.
Stack & Heap: Understanding memory allocation.
Move Semantics: How values are handled by default.
Copy Trait: When values are copied instead of moved.
Hands-On Lab: Experimenting with variable assignment, understanding move and copy behaviour for different data types.
Borrowing and Slices
Borrowing: Creating references to values (immutable & and mutable &mut).
Rules of Borrowing: The single mutable reference or multiple immutable references rule.
Dangling References: How Rust prevents them.
Slices: Creating references to contiguous sequences in collections (String Slices, Array Slices).
Hands-On Lab: Practising borrowing with references, creating and using string and array slices.
Structuring Data with Structs
Structs: Defining custom data types with named fields.
Defining Related Data using Structs.
Instantiating Structs.
Field Init Shorthand.
Struct Update Syntax.
Tuple Structs: Structs without named fields.
Unit-Like Structs.
Methods and Associated Functions: Defining behaviour on Structs.
Ownership of Struct Data: How ownership rules apply to data within Structs.
Hands-On Lab: Defining and using Structs, implementing methods on Structs, creating Tuple Structs.
Enums and Pattern Matching
Enums: Defining types by enumerating possible variants.
Enum variants with associated data.
Methods on Enums.
Defining Types and using Enums.
Introduction to Pattern Matching.
The match control flow operator: Matching values against patterns.
Matching with Enums, Option, and Result types.
The if let control flow.
Hands-On Lab: Defining and using Enums, implementing pattern matching with match and if let.
Keeping track of your project
Packages: Understanding the root of a compilation unit.
Crates: Libraries and binaries.
Modules: Organising code within a crate (mod).
Paths: Referring to items in modules (use, super, self).
Controlling Scope and Privacy: pub keyword.
Hands-On Lab: Structuring a multi-file project using modules, controlling visibility, importing items with use.
Rust Collections
Overview of standard library collections.
Vectors (Vec<T>): Storing lists of values (interpreting "Lists" and "Values" from the outline).
Creating, updating, iterating over Vectors.
Handling Vector elements with ownership and borrowing.
Hash Maps (HashMap<K, V>): Storing key-value pairs.
Creating, inserting, retrieving, updating values in Hash Maps.
Ownership and borrowing with Hash Maps.
Hands-On Lab: Working with Vectors and Hash Maps, performing common operations, managing ownership.
Error Handling
Why Error Handling is important in Rust.
Unrecoverable errors: Using the panic! macro.
Understanding Backtracing with panic!.
Recoverable errors: The Result<T, E> type.
Working with Result using match.
The ? operator for propagating errors.
Defining custom error types.
Hands-On Lab: Implementing error handling using Result and the ? operator, causing and handling panics.
Generics, Traits & Lifetimes
Generics: Writing code that works with multiple Types.
Generic Structs, Enums, Functions, Methods.
Traits: Defining shared behaviour.
Implementing Traits.
Trait Bounds: Specifying that a generic type must implement certain traits.
Lifetimes: Ensuring references are valid.
Lifetime annotations.
The 'static lifetime.
Hands-On Lab: Writing generic functions and structs, defining and implementing a simple trait, applying lifetime annotations where needed.
Testing
Importance of testing in Rust.
Writing tests: The #[test] attribute.
Asserting outcomes (assert!, assert_eq!, assert_ne!).
Running tests with cargo test.
Unit tests: Testing individual units of code.
Integration tests (brief overview).
Testing with should_panic.
Hands-On Lab: Writing unit tests for functions and methods, running tests with cargo test.
OO Programming and Functional Programming in Rust
OO Programming: Discussion - Is Rust really an Object Oriented language?
Objects in Rust: Encapsulation and polymorphism through Traits.
Encapsulation in Rust (using modules and pub).
Trait Objects: Achieving polymorphism at runtime.
When to use OO patterns in Rust.
Functional programming: Concepts in Rust.
Iterators: Working with sequences of elements.
Closures: Anonymous functions that can capture their environment.
Comparing Loops or Iterators? for different tasks.
Hands-On Lab: Implementing polymorphism using trait objects, working with iterators and closures.
Smart Pointers
What are Smart Pointers? Beyond simple references.
Using Box<T>: Allocating values on the heap.
The Drop trait: Customizing cleanup code.
Other Smart Pointers (brief overview): Rc<T> (Reference Counting), Arc<T> (Atomic Reference Counting), RefCell<T> (Interior Mutability).
Hands-On Lab: Using Box for heap allocation, implementing the Drop trait for a custom type.
Concurrency
What is Concurrency? Challenges in concurrent programming.
Creating new threads: The std::thread::spawn function.
Join Handles: Waiting for threads to complete.
Message Passing: Communicating between threads using Channels (std::sync::mpsc).
Shared State Concurrency (brief overview): Mutex, RwLock, Atomic.
Understanding the Sync and Send Traits for fearless concurrency.
Hands-On Lab: Creating and joining threads, implementing message passing using channels.
-
The Rust Programming Language (The Book): The official, comprehensive guide to Rust. Essential reading.
Rust Official Documentation: The main hub for all Rust documentation, including the standard library API reference.
Rustup: The recommended toolchain installer for managing Rust versions and targets.
Crates.io: The official registry for Rust libraries (crates).
Rust Test Documentation: Information on how to write and run tests in Rust.
Trusted by



