The Rust Programming Language
4.3 (1,681 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
8,751 students enrolled

The Rust Programming Language

Learn a modern, powerful yet safe systems programming language!
Bestseller
4.3 (1,681 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
8,748 students enrolled
Created by Dmitri Nesteruk
Last updated 4/2020
English
English [Auto-generated], French [Auto-generated], 1 more
  • Portuguese [Auto-generated]
Current price: $69.99 Original price: $99.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 8 hours on-demand video
  • 23 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Solve problems in Rust
  • Understand Rust's strengths and weaknesses
  • Effectively leverage Rust's memory safety guarantees
  • Write applications and libraries
  • Test and document your code
Course content
Expand all 59 lectures 07:55:30
+ Introduction
5 lectures 24:35

Welcome to the course! Now, for a taste of things to come...

Preview 03:32

Let's get started by installing Rust.

Installing and Configuring Rust
02:40

The obligatory Hello, World! demo, made with Rust.

Hello, Rust!
03:31

Learn about Cargo, Rust's own project and dependency management system. 

Note that Cargo configures your folder to be a Git repository and creates a .gitignore file.

Introducing the Cargo Package Manager
07:59

A discussion of the free IntelliJ IDEA Community IDE and how to set it up to work with Rust.

Preview 06:53
+ Types and Variables
7 lectures 01:18:46

An overview of bits, bytes and the sizes of numbers that can be represented in a typical programming language.

Numbers on the Computer
25:59

Some preliminaries before we get started. Here we discuss the application entrypoint — the main function; also we discuss functions in general and the println! macro.

Application Entrypoint
03:01

Learn about boolean, integral, floating-point types and the char type.

Core Data Types
16:12

A description of some of the Rust operators such as +, <=, && and so on.

Operators
10:25

A discussion of scopes and how variables in inner scopes can shadow outer variables.

Scope and Shadowing
06:13

Global values that are unlikely to change.

Declaring and Using Constants
04:32

Learn about the distinction between the stack and the heap,

Stack and Heap
12:24
+ Control Flow
5 lectures 30:53

Learn about the if statement, including some unusual syntax. (And no, Rust does not have a ternary ?: operator.)

If Statement
07:20

A look at conditional and unconditional loops.

While and Loop
04:08

for loops... also very unusual.

For Loops
04:47

A look at match which lets you pick the right option based on matching input plus additional conditions. Very powerful!

Match Statement
05:25

A simple example using control flow constructs.

Combination Lock
09:13
+ Data Structures
9 lectures 01:12:30

A very important topic! Structs let us keep related data together in a single object.

(Note: there is no concept of constructor in Rust.)

Structs
03:40

A traffic light can be red, green or blue. How to best represent this information in a program?

Enumerations
08:59

With the release of Rust 1.19, we've got a new data type called a union. A union can define several fields of different type, but they all occupy the same memory. Unions are very useful for C interop, among other things.

Preview 08:42

Here we talk about a very useful type called Option<T>, the None/Some(x) duality, and also discuss the if let and while let declarations.

Option<T> and if let/while let
05:25

Learn how to store multiple values of any type in a single data structure as well as how to go over those values.

Arrays
13:03

A slice is a read-only view into an array or a vector.

Slices
05:26

Learn about tuples, their destructuring and indexing. (Yes, destructuring is a word.)

Tuples
09:31

Now that we know more about various data structures, let's revisit the match keyword and discuss pattern matching, an extremely powerful technique.

Pattern Matching
11:50

Learn about generic structures.

Generics
05:54
+ Standard Collections
4 lectures 36:08

A look at the key Rust collections.

Overview
03:47

A vector is like an array, but resizeable. Also behaves like a stack.

Vec(tor)
13:09

A key-value store that allows fast access and update/upsert operations.

HashMap
07:26

A data structure that represents a mathematical set.

HashSet
11:46
+ Characters and Strings
3 lectures 26:50

Strings are used to store text (i.e., sequences of characters). Learn about both str and String. Both are valid UTF-8 sequences of bytes.

Why does str exist? Because an ordinary slice of a String is effectively a slice of Vec<u8>, which is not very useful.

Strings
11:00

Learn about the format! macro.

String Formatting (format!)
07:43

A tiny game.

Number Guessing Game
08:07
+ Functions
4 lectures 30:19

We've already met the function main, but now we discuss functions at large.

Functions and Function Arguments
06:38

A struct can have not just fields but also its own functions!

Methods
02:58

How do you store a function in a variable? How do you pass a function to some other function? These concerns are addressed with closures (a.k.a. lambda functions).

Closures
10:48

Functions that return functions. Don't worry, it's not as scary as it sounds.

Preview 09:55
+ Traits
9 lectures 01:12:30

Traits let you specify that a type must possess certain aspects.

Traits
12:41

Three forms of syntax for passing traits as parameters.

Trait Parameters
06:50

A look at the Into trait, which helps with automatic conversions.

Into
05:59

A way of giving your structs destructors.

Drop
05:59

Learn how to define the behavior of operators such as + for your own structs.

Preview 16:49

One of two possible forms of dispatch. Static dispatch is when the compiler knows exactly which realization of function to call.

Static Dispatch
06:33

What if the compiler doesn't know which trait implementation to call?

Dynamic Dispatch
03:07

So given that static dispatch is faster, why would we want to use dynamic dispatch, anyway?

Preview 05:03

You cannot make vectors of different objects. But if you really need to, you can make a vector of enum cases or of pointers (&, Box, Rc, etc.)

Vectors of Different Objects
09:29
+ Lifetime and Memory
7 lectures 45:43

Learn about ownership, move semantics and move-able types.

Ownership
08:31
Borrowing
07:12

We finally get to look at explicit use of lifetime specifiers. Woo-hoo!

Lifetime
07:50

A look at how lifetimes are defined in implementations of structs.

Lifetime in Structure Implementation
04:41

In addition to ownership/borrowing, Rust also supports the notion of reference-counted variables. These are somewhat easier to share. The approach is similar to C++'s shared_ptr/unique_ptr.

Reference-Counted Variables (Rc)
06:27

A reference-counted variable (Rc) is safe to share around within a single thread. But what if we want to share it around in multiple threads? How can we ensure its pointer count is actually safe from concurrent modification? That's what the Arc class is for.

Atomic Reference-Counted Variables (Arc)
03:57

Arc protects the reference count, but it doesn't protect the variable itself, so concurrent modification of the variable will still be prohibited by the Rust compiler. How can we get concurrent code that mutates the variable to work? One option is to use a Mutex.

Using a Mutex for Thread-Safe Mutability
07:05
+ Advanced Topics
1 lecture 25:12

In Rust, circular references are difficult to get right.

Circular References
25:12
Requirements
  • Basic knowledge of computer science
  • A computer with a Rust-enabled IDE (VisualRust, intellij-rust, etc.)
Description

This course will teach you the fundamentals of Rust, a modern programming language that has the both the power of native code as well as the safety of some managed languages. In this course you will learn the following:

  • How to download and install Rust; how to compile programs and (optionally) work with an IDE.
  • Learn about fundamental data types and how to use them to declare variables.
  • Undersand arrays, vectors and strings, the concept of slices.
  • Learn to create functions, methods, closures, higher-order functions.
  • Understand how to create various data structures such as structs and enums; also traits.
  • Master Rust's explicit take on the concept of lifetime with ownership, borrowing, lifetime specifiers, lifetime elision.
  • Learn how to safely share data around your (possibly multithreaded) application with Rc, Arc and Mutex.
  • Use Rust's package managent using Cargo.
  • Learn about other useful topics: documentation, conditional compilation, testing.

This course, like all my other courses, will be supplemented with additional lectures based on participants' requests.

Who this course is for:
  • Systems programmers
  • Experienced developers interested in Rust
  • C/C++ programmers