Lectures

Lecture Slides and Video Recordings

The presentation slides used in these lectures will be posted in this page before the lectures, and may be updated after each lecture is concluded. There are a total of 12 lectures in this course, each two hours.

Introduction to the Course

  • About me
  • Goals and the course structure (4 assignments, 1 project)
  • Course website
  • Textbook
  • Grading policy
  • Advantages of the Rust programming language

Learning Rust the Hands-On Way

  • Reading the errors carefully
  • Installing and using the Rust toolchain
  • Creating, building, and running the first Rust project
  • Implementing a guessing game

Lecture 1 Recording (Part 1)

Lecture 1 Recording (Part 2)

Basic Programming Concepts

  • Mutable and immutable variabls
  • Static types
  • Scalar data types
  • Compound data types
  • Functions
  • If expressions
  • Loops

Ownership and the String Type

  • Ownership: a unique feature in Rust towards memory safety
  • The String type
  • References and borrowing
  • String slices

Lecture 2 Recording (Part 1)

Lecture 2 Recording (Part 2)

Quiz 1 Sample Questions

Quiz 1 Sample Questions — Answer Key

Structs and Enums

  • Defining and instantiating structs
  • Methods
  • Enums
  • Options
  • Pattern matching
  • The power of enums
  • Characteristics of object-oriented languages

Lecture 3 Recording (Part 1)

Lecture 3 Recording (Part 2)

Quiz 1 Questions

Quiz 1 Questions — Answer Key

Quiz 2 Sample Questions

Quiz 2 Sample Questions — Answer Key

Lecture 4 Recording (Part 1)

Lecture 4 Recording (Part 2)

Quiz 2 Questions

Quiz 2 Questions — Answer Key

Error Handling

  • Recoverable and unrecoverable errors
  • Handling unrecoverable errors with panic!
  • Handling recoverable errors with Result
  • To panic! or not to panic!

Quiz 3 Sample Questions

Quiz 3 Sample Questions — Answer Key

Vectors and Hash Maps

  • Storing lists of values in vectors
  • Storing key-value pairs in hash maps

Lecture 4 Recording (Part 1)

Lecture 4 Recording (Part 2)

Sample Midterm Examination 1

Sample Midterm Examination 1 — Answer Key

Sample Midterm Examination 2

Sample Midterm Examination 2 — Answer Key

Sample Midterm Examination 3

Sample Midterm Examination 3 — Answer Key

Quiz 3 Questions

Quiz 3 Questions — Answer Key

Midterm Examination

Midterm Examination — Answer Key

Generics and Traits

  • Generic data types
  • Traits: defining shared behaviour across structs

Lifetimes

  • Basic concepts of lifetimes
  • Providing hints to the compiler using lifetimes