
Begin learning Rust by coding along, completing quizzes and exercises, experimenting with code, and carefully reading compiler error messages to build solid Rust syntax and understanding.
Install rust on your local machine using rust up, then verify the installation with cargo and prepare your terminal for Rust development.
Build a deck of playing cards project in Rust, learn cargo by creating it with cargo new and running it with cargo run, then use the quiet flag.
Explore representing data with a deck struct in Rust, using a vector of strings for cards, creating instances, and printing with the print line macro.
Learn to read Rust compiler errors, use debug formatting to print a deck struct, and apply derive debug to add functionality to structs for readable output.
Learn to build a 52-card deck by combining suits and values with vectors and arrays in Rust, using a double nested loop and the format macro, and handle mutability.
Discover how Rust bindings are immutable by default and how the mut keyword enables changing a vector. Use the formatter with colon pound to print the deck neatly.
Create an inherent implementation for deck and define a new function that returns self to construct a deck. Explain the difference between associated functions and methods, using self for methods.
Explore Rust's implicit return, where the last expression is automatically returned when you omit the return keyword and no semicolon, enabling concise deck creation with cards.
Add a shuffle method on the deck to randomize cards, using the rand crate installed with cargo add, and consult crates.io and docs.rs for usage while exploring the standard library.
Access thread_rng from the rand crate and the slice_random trait to shuffle vectors, while organizing code with root and submodules and using mod and use for external versus internal crates.
Mark the deck as mutable to shuffle the cards vector and use a mutable reference (ampersand mut) with a thread rng to randomize the deck.
Add a deal method that returns a set number of cards in a new vector. It uses split_off on the deck to move cards by usize indexing.
Review the Rust concepts: use statements, curly-brace imports, derive for debug, and let and mut. Understand structs with inherent implementations, methods versus associated functions, and the main function.
Begin a Rust project with cargo to build a bank with accounts, balances, and account numbers. Encounter a mysterious error, dive into new Rust systems, then finish the project.
Define two Rust structs, account and bank, with fields id, balance, and holder, derive debug, and use a vector of accounts in the bank for debugging output.
Implement inherent constructors for bank and account in Rust. Create a bank with an empty accounts list and accounts with an id and holder, balance starting at zero, plus tests.
Explore implementing and debugging Rust console output by printing bank and account structs, handling string slices versus Strings, and resolving a move error caused by reusing account.
Learn Rust's ownership, borrowing, and lifetimes to prevent shared-data bugs, understand the 12 rules, and see how strict ownership stops unintended value updates in programs.
Explore how ownership and borrowing in Rust prevent bugs from shared references by using read-only references or separate engines, and derive rules to ensure safe updates.
Master Rust's ownership basics by exploring rules: each value has a single owner and moves on reassignment, with bank examples and compile-time errors when accessing moved values.
Visualize Rust ownership and moves by examining how values can be owned by variables, structs, or vectors, and how moves transfer ownership, leaving the old owner invalid.
Practice Rust ownership by declaring and calling a function that takes ownership of the account value and prints it, using the official online Rust code editor to run and experiment.
Demonstrates a Rust exercise solution by defining a print_account function that prints an account, explains moving the account value prevents a second call, and shows a moved value error.
Practice taking ownership of the bank's accounts field by adding a print_accounts function that prints a vector of accounts, called from main.
Explore a Rust exercise solution by defining a print_accounts function, passing an accounts vector by ownership, and diagnosing a partial move error in a bank struct.
Explore Rust's ownership system, showing how returning the account from print_account enables two prints with a mutable binding, before introducing the borrowing system.
Explore the borrow system by using references to pass values without moving ownership, illustrated through a code example that prints an account value twice.
Explore the Rust borrow system by creating references with the ampersand, distinguishing read-only (immutable) references and how multiple such references can exist simultaneously, while preventing moves.
Create a print_num_accounts function above main that accepts a bank, prints bank_accounts.len(), call it from main, then print the bank, noting avoiding ownership transfer.
Learn to implement a print_num_accounts function in Rust by using a reference to a bank, avoiding ownership transfer, and printing the number of accounts with bank_accounts.len.
Explore mutable references in Rust by using the ampersand to modify data in place. Learn constraints that prevent using read-only and mutable references together and limit to a mutable reference.
Practice building a Rust function add account that mutably references a bank and pushes a new account into the bank's accounts vector while managing ownership and mutable references.
Explore how to design a Rust function add_account using a mutable reference for bank and a value for account, illustrating ownership and move semantics when updating a bank’s accounts vector.
Learn how Rust's ownership rule seven makes copyable values, like numbers, booleans, chars, and copyable arrays or tuples, be copied rather than moved, enabling multiple prints and preventing ownership errors.
Explore lifetimes in Rust, clarifying how ownership and memory are dropped when a value goes out of scope, and why returning references requires lifetime annotations and safe rules.
Learn to decide ownership, borrowing, and lifetimes for function arguments and returns in Rust, using a bank and accounts example to choose values versus references.
Add a mutable add_account method to the bank struct that takes ownership of an account and pushes it into the accounts vector, tested by mutably printing the bank in main.
Implement deposit and withdraw methods on an account to update the balance. Explore how to pass the amount as a value or reference and return the updated balance.
Implement an account summary method that formats holder and balance into a string, and add bank methods to compute total balance and collect account summaries using iterators, map, and collect.
Wraps up the project by reinforcing Rust ownership, borrowing, and lifetimes, and highlights three hard rules about moving values, mutating through owners, and references when out of scope.
Create Simply Media project in Rust with cargo new, model books, movies, and audiobooks, and manage them in a catalog with add and search operations by title, author, or director.
Learn how Rust enums represent data like books, movies, and audiobooks with associated data, enabling a single print function and reusable code across types.
We declare an enum and reuse it to model audiobook, a movie, and a book, then pass them to the print media function.
Attach a description method to a media enum to create variant-specific descriptions for books, movies, and audiobooks. Compare an impl block with pattern matching to access title, author, and director.
Discover the Rust rule of thumb for choosing structs or enums when modeling items with either the same methods or different ones, illustrated by books, movies, and audiobooks.
Define a catalogue struct with an items vector that can hold books, audiobooks, or movies, and implement new and add methods for ownership-based updates.
Explore Rust enums with labeled and unlabeled fields, adding variants like podcast and placeholder, handling exhaustive matches and a podcast episode number represented by u32.
Explore how Rust's option enum replaces null by returning Some or None, and learn to use match or if let to safely access vector elements.
Explore building a custom get by index for a catalog enum in Rust, returning either a reference or the none variant, with lifetime annotations, pattern matching, and out-of-bounds error handling.
Replace a custom enum with Rust's built-in option enum to fetch by index, return some or none, apply generics, and verify behavior with a match.
Discover three alternative ways to access an option’s value—unwrap, expect, and unwrap_or—alongside when each can panic or supply a default, with examples and documentation tips.
Practice rust vectors and options by accessing the first account with first_mut, matching on some or none, updating the balance to 30, and printing the result or 'no account found'.
Access a mutable reference from the accounts vector using first_mut, handle the Option via match, update the balance to 30, and print results, including a no account found path.
Learn how to organize Rust code with modules, refactor a messy main.rs into a content submodule, and compare three module patterns: in-file mod, separate content file, and nested multi-file structure.
Learn how rust modules work: each file creates a module, folders create content modules with nested media and catalog, and one-level import rules via pub mod to expose items.
Refactor a Rust project by creating a content module with catalog and media submodules, turning structs, enums, and functions public, and using mod and use statements to simplify cross-module access.
Create a Rust project with cargo new, build a simple log reader that reads logs.txt, extracts data, and emphasizes robust error handling with clear user error reporting.
Learn how to read a file in Rust by loading logs.txt with std::fs::read_to_string, handle results with the option-like enum, and run the program with cargo run.
Explore how Rust handles errors with the result enum in a divide function, using the okay and error variants, and compare it to the option enum's some and none.
Define a divide function returning a generic result enum with Ok and Err variants, returning can't divide by zero as the error message and illustrating Rust's typing.
Explore how Rust uses io::Error from the standard library, importing it, and creating an Other error variant inside a divide function to signal failures.
Call divide from main with 5.0 and 3.0 to produce a result. Use a match to handle ok variant or error variant and print the can't divide by zero error.
Explore empty ok variants in Rust by using the result enum to signal success with an empty tuple, illustrated with email validation and file write scenarios.
Practice validating a vector of ingredients in Rust, ensuring at most three items, returning a result, and using a match statement to print success or failure.
Walks through implementing a Rust validate function that returns a Result, using an error variant for invalid input and an ok variant for success, with a match-based flow.
Explore using Rust's result enum to read files with read_to_string, match on ok or error variants, and print the text length or a descriptive error message.
Parse logs in Rust by extracting error lines and practicing string handling. Explore Rust string types, including String, &String, and &str.
Explore how Rust uses the stack, heap, and data segment to manage memory, showing a vec’s length, capacity, and pointer while data lives on the heap.
Analyze capital S string, ampersand string, and ampersand str (string slice) in Rust, examining their stack and heap layouts. Learn how length, capacity, and pointers differ across these types.
Explore why Rust provides String, string slices, and string references, how slices avoid heap allocation for text, and when to use each for ownership, growth, and read-only access.
Explore implementing the extractors function in Rust that splits text into lines and collects lines starting with air into a vector of string slices, while examining ownership, borrowing, and lifetimes.
Examine how ownership, borrowing, and lifetimes interact with string slices when split returns a vector that borrows text, causing a 'doesn't live long enough' error.
Apply a minimal fix by converting a string slice to a string and updating the results to a vector of strings, illustrating ownership and heap allocation in Rust.
Write text to a file in Rust by joining a vector of strings with newlines, writing to errors.txt, and handling the result with match for success or failure.
Refactor the main function by replacing nested matches with option and result methods like unwrap and expect, and compare three error-handling approaches, including panics.
Learn three Rust error-handling techniques for Result: match statements, unwrap/expect, and the try (question mark) operator, including returning Result from main and automatic error printing.
Learn when to use the try operator, unwrap, or expect, and when to favor match or if let for error handling and propagating errors in Rust.
learn to use Rust iterators to traverse a vector of strings, while exploring ownership, borrowing, lifetimes, and the option enum, through building a simple Iter project with Cargo.
Explore basics of iterators in Rust by turning a colors vector into an iterator, using next to walk through red, green, and blue, and understand why mutable state is required.
Implement a print elements function that takes a vector by reference and uses a for loop to print each item, contrasting iteration with iterator adapters like foreach, map, and collect.
Rewrite the print elements function with elements.iter and for each to print each item, and explain that iterators are lazy, starting with next or a consumer.
Explore iterator adaptors in Rust, using map to add processing steps and print elements twice; learn how adapters differ from consumers and why iteration is lazy until consumed.
Explore string slices and vector slices in Rust, and learn why vector slices let print elements accept full vectors or slices for improved flexibility.
Modify a vector of strings in place by applying truncate to shorten each string to its leading character, using a mutable reference and ownership and borrowing guidance.
Compare iter, iter_mut, and into_iter to handle read-only references, mutable references, and ownership when iterating over a vector.
Explore mutable vector slices in Rust by using a mutable reference to a string slice, letting shortened strings operate on entire vectors or on specific sub-slices like colors[1..3].
Learn to collect elements from an iterator into a new vector by mapping each item to uppercase, illustrating the difference between in-place changes and creating a new collection.
Shows how Rust's collect gathers iterator items into vectors, maps, or lists, guided by type annotations, including return type, variable annotations, and turbo fish syntax.
move elements demonstrates transferring all items from one vector to another using into_iter to take ownership, highlighting ownership semantics when iterating with reference, mutable reference, or by value.
Explode takes a vector of strings and returns an outer vector of inner vectors, mapping each string to its characters and collecting them into separate inner vectors.
Explore Rust lifetimes and ownership by implementing find_color_or, which searches a color slice for a match and returns an owned string, using a fallback when no match is found.
Explore how iterators power search and transformation with find, map, and closures. Apply iterator consumers, adapters, and creation methods: iter, into_iter, and iter_mut, to manage references and options in Rust.
Practice with iterators by pulling balances from a list of accounts, collecting them into a vector, and fixing a collect type annotation error with guidance from the collect video.
Add a type annotation to the collect function to define the target data structure as vec<i32>, either at vec creation or after collect with ::<vec<i32>>; omitting i32 also works.
Explore how to use the filter iterator adapter to identify accounts with negative balances by adding a new step in the processing pipeline.
apply rust's filter to keep only accounts with negative balances by using a closure that returns true for balance below zero, then collect results into a vector.
Master lifetime annotations in Rust by exploring how references must not outlive their data using a bank and account example.
Implement a next_language function in Rust that takes a list of languages and a current string slice, returning the next language. Address a lifetime annotation and unwrap the last element.
Review how lifetimes define variable duration, how references must not outlive their values, and how lifetime annotations fix borrowing rules by illustrating scopes, drops, and references.
Learn how lifetime annotations in Rust tie a function’s return reference to data from its two input references, using the 'a lifetime.
Explore how lifetime annotations decide whether a returned reference ties to the first or second argument, and why Rust requires explicit lifetimes for safe, clear function signatures like split.
Explore lifetime annotations and their elision in Rust, showing how to annotate or omit lifetimes when taking and returning references, including corner cases and the single-argument elision rule.
Explore the longest function in Rust with two string slices, returning the longer input reference, and learn how lifetime annotations relate the returned reference to one of the input references.
Explore generics in Rust by creating a Cargo project, adding numb-traits, and implementing a Pythagorean theorem function to compare floats.
Rust does not auto convert numbers between types, so arithmetic across types requires explicit conversion, for example using a as f64 or the num_traits two f64.
Explore the basics of generics in Rust by turning the solve function into a generic, type-parametered tool that handles f32 and f64 and demonstrates type inference.
Explore how traits define methods and how trait bounds constrain generics, using vehicle and float with f32 and f64; see why i32 fails.
Learn to extend a Rust function with two generics, T and U, to accept f32 and f64 inputs, clarifying why distinct types enable two different values.
Refactor the sell function to accept any number type using the two primitive trait, enabling i32, u8, and other numbers to work via the NUM Traits crate.
Explore rust generics and traits by building a basket and a stack. Store any data type with get returning an option, put, and is_empty, and see a numeric addition case.
Create a plain basket struct that stores an optional string and offers take, put, and is_empty methods, while wiring the module with mod basket and a use statement in main.rs.
Convert a string-only basket into a generic struct by introducing a type parameter t and replacing string with t across the struct and its implementation.
Learn to implement a stack that stores unlimited items with a vector, add get and put operations, and evolve from a string-only version to a generic trait in Rust.
Define a generic trait container with get_mut, put, and empty for any data type; implement it for basket and stack to enable interchangeable use across the application.
Apply a generic Rust function to insert a string into any string-specialized container, using a trait bound to enforce container capabilities and demonstrate with baskets and stacks.
Welcome to the most comprehensive and hands-on course for learning Rust from the ground up!
Rust is revolutionizing systems programming with its focus on memory safety, concurrency, and performance. But with its unique concepts and syntax, many find Rust challenging to learn. That's where this course comes in – providing you with a clear, structured path to Rust mastery.
What sets this course apart? We focus on building a rock-solid foundation in Rust's core concepts. No fluff, no skipping steps – just pure, essential Rust knowledge that will set you up for success in any Rust project.
Rust's most challenging concepts are covered:
Rust's ownership model? Explained in great detail!
Lifetimes and borrowing? Its here!
Traits and generics? You'll use them to write flexible code
This course is designed for developers who want to truly understand Rust, not just copy-paste code. Whether you're coming from Javascript, Python, or any other language, you'll find a welcoming introduction to Rust's unique paradigms.
Rust has been voted the "most loved programming language" in the Stack Overflow Developer Survey for seven consecutive years. It's not just hype – major companies like Microsoft, Google, and Amazon are increasingly adopting Rust for critical systems. By mastering Rust, you're not just learning a language; you're future-proofing your career.
Here's a (partial) list of what you'll learn:
Dive deep into Rust's type system and how it ensures memory safety
Master pattern matching and destructuring for elegant, expressive code
Harness the power of Rust's error handling with Result and Option types
Explore Rust's module system to organize and scale your projects
Implement common data structures and algorithms the Rust way
Use cargo to manage dependencies and build your projects with ease
A solid grasp of Rust's syntax and core concepts
The ability to write safe, efficient, and idiomatic Rust code
Confidence to tackle real-world Rust projects and contribute to the ecosystem
A deep and fundamental understanding of error handling
The skills to optimize code for performance and memory usage
And much more!
How This Course Works:
This isn't just another "follow along" coding course. We've structured the learning experience to ensure you truly internalize Rust's concepts:
Concept Introduction: Clear, concise explanations of each Rust feature
Live Coding: Watch as we implement concepts in real-time, explaining our thought process
Challenges: Test your understanding with carefully crafted coding exercises
Project Work: Apply your skills to build progressively complex projects
Best Practices: Learn idiomatic Rust and industry-standard coding patterns
This is the course I wish I had when I was learning Rust. A course that focuses on the hardest parts, gives clear explanations, and discusses the pros and cons of different design options. Sign up today and join me in mastering Rust!