Sign in

Rust for PHP Developers

Course home

Start the course

Installation

The Basics

The first lessons are free. Sign in to track your progress.

Start watching

Modules

01

The Basics

This module introduces the foundational concepts of Rust, guiding you through the essential building blocks of the language. You'll start by setting up your Rust environment, and then dive into key topics like variables, data types, control structures, and functions. By the end, you'll have a solid understanding of how these things look and feel in Rust, setting the stage for more advanced programming concepts.

02

Custom Data Structures

This module focuses on creating and using custom data structures in Rust. You’ll begin by learning how to define and work with "structs" to encapsulate related data into a single unit. Next, you'll explore "enums" to represent a variety of data types and handle multiple possible values elegantly.

03

Null-safety & Error Handling

This module compares the error handling and null-safety features of PHP and Rust and explains the benefits of Rust's approach.

04

Pattern Matching

We'll dive deep into Rust's exceptional pattern matching feature set, looking at how we can match against entire expressions, break down patterns and destructure values and take advantage of pattern matching inside of various control structures.

05

References

PHP has a concept known as "references", but it doesn't behave in quite the same way as Rust's. In this module, we'll talk about the differences between "pass by-value" and "pass by-reference" and how we can take advantage of references in Rust.

06

All About Strings

We've spoken about strings already, but Rust has a unique way of representing strings. In this module, we'll talk about the various string types that Rust offers and how they relate and compare to each other.

07

Memory Management & Ownership

So far, we've not run into many issues with Rust's memory model, but as you progress on your Rust journey, chances are you'll start dealing with (or battling) the "Borrow Checker". This module will give you a baseline understanding of Rust's memory model, "Ownership", "Lifetimes" and the borrow checker.

08

Composition & Generic Programming

In this module, we'll dive into Rust's powerful composition feature and "traits". We'll explore how traits make it easy to define shared behaviour across multiple different types. We'll also cover the basics of generic programming in Rust and talk about how it makes it easy to design functions and structures that work with a variety of types.

09

Code Separation

This module covers the fundamentals of organising and structuring Rust code. Begin with "Crates 101", we'll talk about what a "crate" actually is. Next, we'll cover "modules" to understand how we can divide our code into manageable sections, enhancing readability and maintainability.

10

Smart Pointers

PHP's garbage collector and reference counting handle shared data for you, but Rust makes you pick the right tool. In this module, we'll look at how smart pointers differ from plain references, then work through Box, Rc and RefCell, before moving on to the thread-safe Arc, Mutex and RwLock.

Coming soon

  • Stack vs. Heap
  • Arc
  • Mutex
  • RwLock
  • Build a todo application
  • Concurrency