Rust Fundamentals

Overview


In this part, we look into learning the basics of the Rust programming language. Rust is a modern systems programming language that emphasizes safety, performance, and concurrency. It achieves memory safety without a garbage collector through a unique ownership system.

This part is organized as follows:

  • Your Typical Language Introduction: Here we take a break from π•Šπ•‹π•ƒβ„‚++ and focus on learning Rust.
  • Ownership and Borrowing introduces Rust’s unique ownership model.
  • Control Flow and Pattern Matching. Control flow is done quite differently in imperative versus functional programming languages. However, we try to take what you learned from π•Šπ•‹π•ƒβ„‚++ and apply those principles to Rust β€” and we get something many Rust programmers would consider idiomatic code.
  • Structs, Enums, and Error Handling. Creating custom data types is an essential skill, and that’s why we look at it both from a functional and an imperative point of view. We will also study some details of memory management and how data is laid out in memory.
  • Collections and Iteration. Loops will be discussed both from a functional and an imperative point of view.
  • Generics and Traits. Here we take what we learned from polymorphism in π•Šπ•‹π•ƒβ„‚++ to another level. You will learn to use traits to write high quality generic code, and learn the key principles of solid API design.
  • Modules and Testing briefly showcases how to organize larger Rust programs into modules and packages, and how to write tests for your code.

Finally, at the end, there is a recap and feedback chapter.

Prerequisite Graph

The following diagram highlights the dependencies between the chapters in part 1 and part 2 (this part).

  • A solid arrow from chapter 𝐴 to a chapter 𝐡 means that 𝐡 is a strict prerequisite to 𝐴. A strict prerequisite in this context means that 𝐴 uses terminology and concepts introduced in 𝐡.
    • A dotted arrow from 𝐴 to 𝐡 indicates a weak prerequisite. A prerequisite is weak if it contains useful and related concepts, but not strictly necessary to understand 𝐴.
π•Šπ•‹π•ƒβ„‚++Rust12345678912345678Dependency graph of chapters in parts 1 and 2.