Skip to content

Academy

Rust Basics

Rust for people who already know another language: ownership, borrowing, Option, Result, cargo and tests, finishing with a program of your own.

Beginner10 lessons900 minCourse in English

Free10 lessons
Enrol for free

Lifetime access, updates included

This course is for people who already know a little of another programming language (Python, JavaScript or C, for example) and want to start writing Rust. I do not explain what a variable or a loop is, but I cover everything that is specific to Rust step by step: ownership, borrowing, the Option and Result types, pattern matching and the cargo tool.

Every lesson has the same layout: a goal, an explanation with examples, typical compiler errors (with real messages) and exercises with solutions. It is best to read with a terminal open and type the examples in yourself: in Rust you learn the most by reading what the compiler tells you.

All the examples were compiled and run on Rust 1.98.1 (September 2026) with the 2024 edition. The program outputs and error messages are real, sometimes slightly shortened. In other compiler versions the wording of the messages may differ slightly, but the meaning stays the same.

What you’ll learn

  • You will install Rust (rustup or dnf) and work with cargo: creating, building and running projects
  • You will understand variable immutability, the basic types and shadowing
  • You will master ownership, borrowing and references, the things that set Rust apart most from other languages
  • You will tell String from &str, and work with vectors and slices
  • You will build your own structs with methods and enums handled with match
  • You will handle errors without exceptions: Option, Result and the ? operator
  • You will split code into modules, add dependencies from crates.io and write tests
  • You will write a complete command-line unit converter

Who it’s for

  • Programmers who know Python, JavaScript, C or another language and are starting with Rust
  • People who have tried Rust and got stuck on a compiler that rejects their code over ownership and borrowing

Requirements

  • Programming basics in any language (variables, loops, functions)
  • A computer running Linux, macOS or Windows with internet access (to install Rust)
  • Rust 1.85 or newer (the 2024 edition); Lesson 1 covers the installation

Course programme

  1. 01Getting started3 lessons
    • Installation and your first project
    • Variables, mutability, types and shadowing
    • Functions and control flow
  2. 02Ownership and data3 lessons
  3. 03Enums and error handling2 lessons
    • Enums, Option and match
    • Error handling: Result and the ? operator
  4. 04Code organisation and the final project2 lessons
    • Modules, crates, dependencies and tests
    • Mini project: a command-line unit converter

Author

wirelab

Write