Rust Fundamentals Course

Начать

This course provides a thorough and practical introduction to the Rust programming language, guiding you from its core syntax to the unique concepts that make Rust safe, fast, and reliable. Designed for beginners with some prior programming experience, it builds understanding progressively by working through real code examples at every step.

You will start with the basics — variables, types, and functions — before diving into Rust's defining feature: the ownership and borrowing system. From there, the course covers structs, enums, pattern matching, error handling, collections, traits, generics, and the iterator model, giving you a complete picture of how idiomatic Rust is written.

By the end of this course, you will have a solid foundation in Rust and the mental models needed to write safe, efficient code. You will understand why Rust makes the choices it does, and you will be equipped to explore more advanced topics like lifetimes, async programming, and building real-world applications.

Совместимая лаборатория

Rust Sandbox

Learn and test Rust online in a secure sandbox. Write, run, and prototype Rust code safely in the browser without any installation...

10,0 (1)

Главы

12
Глава 1

Getting Started with Rust

This chapter introduces Rust — what it is, why it was created, and what problems it solves. It covers the core promises of the language (memory safety without a garbage collector, zero-cost abstractions, and fearless concurrency) and walks through the Cargo build system and the structure of a basic Rust project.

Глава 2

Variables, Types, and Functions in Rust

This chapter covers the building blocks of any Rust program: declaring variables with `let` and `let mut`, Rust's scalar and compound data types (integers, floats, booleans, chars, tuples, and arrays), and defining functions with typed parameters and explicit return values.

Глава 3

Memory Without a Garbage Collector

This chapter explains Rust's ownership system — the feature that sets it apart from every other language. It covers the three ownership rules, what happens when values are moved or copied, and how references and borrowing let you use data without taking ownership of it.

Глава 4

Structs, Enums, and impl Blocks

This chapter covers structs and enums, Rust's primary tools for creating custom data types. It explains how to define and instantiate structs, attach methods using `impl` blocks, and use enums to represent values that can be one of several distinct variants — including the built-in `Option` enum.

Глава 5

Pattern Matching in Rust

This chapter explores Rust's powerful pattern matching system, focusing on the `match` expression, which exhaustively checks every possible variant of an enum or value. It also covers `if let` and `while let` as concise alternatives when only one pattern is relevant.

Глава 6

Errors: Result, Panic, and the ? Operator

This chapter covers Rust's approach to error handling, which avoids exceptions entirely in favor of explicit return types. It explains the difference between recoverable errors (represented with `Result<T, E>`) and unrecoverable errors (`panic!`), and shows how the `?` operator propagates errors cleanly through a call chain.

Глава 7

Vec, HashMap, and the String Types

This chapter introduces Rust's most commonly used collection types from the standard library: `Vec<T>` for growable sequences, `HashMap<K, V>` for key-value storage, and `String` for owned, heap-allocated text. It also clarifies the important distinction between `String` and `&str`.

Глава 8

Traits and Generics

This chapter introduces traits — Rust's mechanism for defining shared behavior across types, similar to interfaces in other languages — and generics, which allow functions and structs to work with any type that satisfies a set of trait bounds. Together, they are the foundation of reusable, type-safe Rust code.

Глава 9

Iterators and Closures in Rust

This chapter covers closures — anonymous functions that can capture values from their surrounding scope — and Rust's iterator model, which provides a rich set of composable adapters like `map`, `filter`, `fold`, and `collect` for processing sequences lazily and expressively.

Глава 10

Organizing a Rust Project

This chapter explains how Rust organizes code through its module system, covering the `mod` keyword, visibility with `pub`, and the `use` keyword for bringing items into scope. It also dives deeper into Cargo — Rust's build tool and package manager — including how to manage dependencies, use external crates from crates.io, and structure a multi-file project.

Глава 11

Summary

Тест 12

Final Rust Assessment

The final assessment tests your understanding of all topics covered in the Rust Fundamentals course, including ownership and borrowing, structs, enums, pattern matching, error handling, traits, generics, and iterators.

Комментарии

Комментариев пока нет. Будьте первым, кто поделится своим мнением.
Начинающий
0,0 (0)

Автор