Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

Advanced Rust – Lifetimes, Iterators, Testing & Randomness

Packt via Coursera

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Unlock the full potential of Rust programming with advanced topics that are crucial for mastering this language. Through practical lessons on lifetimes, iterators, testing, and randomness, you will gain the deep understanding needed to write more efficient, reliable, and maintainable code. This course explores complex concepts such as non-lexical lifetimes, iterator traits, and the rand crate, while helping you strengthen your problem-solving skills. The course starts with an in-depth exploration of lifetimes, walking you through concrete examples, invalid lifetimes, and generic lifetimes. You'll then dive into the world of iterators, learning how to handle collections, map, filter, fold, and perform other operations. The next section covers Rust’s testing framework, where you will learn everything from writing unit tests to using advanced testing techniques like test-driven development (TDD) and integration tests. Finally, you'll explore randomness, mastering the rand crate and how to apply it to your applications. This course is aimed at intermediate to advanced Rust programmers who wish to refine their skills and apply best practices in real-world projects. It assumes familiarity with basic Rust concepts such as ownership, borrowing, and basic syntax. The difficulty level is advanced, as it explores the nuances of Rust for developers who want to deepen their expertise. By the end of the course, you will be able to implement complex features using lifetimes, iterators, and closures, write effective unit and integration tests, and leverage randomness and time manipulation in Rust applications.

Syllabus

  • Lifetimes
    • In this module, we will dive deep into Rust's lifetime system, exploring concrete lifetimes, non-lexical lifetimes, and their application in function parameters and structs. You’ll also learn how to avoid invalid lifetimes and reinforce your understanding with practical examples.
  • Closures
    • In this module, we will cover closures in Rust, from their basic syntax to more advanced usage, including capturing references, ownership, and using traits like Fn and FnMut. You will practice using closures in real-world scenarios through a project.
  • Iterators
    • In this module, we will explore Rust’s powerful iteration system, including iterator methods for transforming, filtering, and reducing data. You will practice iterating over various data structures and solving problems through hands-on projects.
  • Testing
    • In this module, we will explore how to write tests in Rust, covering unit and integration tests, assertion macros, and advanced techniques like TDD and dependency injection. You will practice writing and running tests to ensure your code is robust and reliable.
  • Randomness with rand Crate
    • In this module, we will introduce the rand crate, teaching you how to generate random numbers and manipulate data randomly in Rust. You’ll get hands-on experience applying randomness to a project, reinforcing your understanding of Rust's randomness capabilities.
  • Datetimes with Chrono Crate
    • In this module, we will explore the chrono crate for handling date and time in Rust. You’ll learn to work with NaiveDate, DateTime, and TimeDelta, manipulating and formatting time and converting between timezones. By the end of the module, you’ll be ready to implement date and time logic in your applications.
  • Regular Expressions with Regex Crate
    • In this module, we will introduce the regex crate for powerful pattern matching in Rust. You’ll learn to search, extract, and replace text using regular expressions, and explore advanced features like anchors, capture groups, and more. By the end of this module, you’ll be able to apply regular expressions to solve real-world problems efficiently.
  • Smart Pointers: Box
    • In this module, we will explore smart pointers in Rust, specifically focusing on the Box pointer. We will investigate how Box helps with heap allocation and enables safe memory management. You'll also gain hands-on experience with linked lists, binary search trees, and essential traits that interact with Box to manage data structures efficiently.
  • Congratulations!
    • In this module, we’ll congratulate you on your hard work and accomplishments in mastering advanced Rust topics. You’ll review the journey from lifetimes and closures to testing and randomness, solidifying your skills for continued growth in Rust programming.

Taught by

Packt - Course Instructors

Reviews

Start your review of Advanced Rust – Lifetimes, Iterators, Testing & Randomness

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.