Back to Modules
Rust Foundations

Learning Module

Rust Foundations

Learn the Rust syntax and ownership model you need before writing Solana programs.

12 lessons
Overview

Rust Foundations

Build enough Rust fluency to reason clearly about ownership, data modeling, control flow, and common program structure.

Start lesson
Theory

Rust Setup and Core Syntax

Install Rust, learn the Cargo workflow, and understand the basic syntax every later lesson depends on.

Start lesson
Challenge

Rust Syntax Practice

Practice variables, functions, loops, and input handling with small focused exercises.

Start lesson
Theory

Ownership and Borrowing

Understand moves, immutable borrows, mutable borrows, and how Rust prevents invalid memory access.

Start lesson
Challenge

Ownership and Borrowing Practice

Practice the rules around references, mutation, and move semantics without falling back to unnecessary cloning.

Start lesson
Theory

Structs and Methods

Model related data with structs and attach behavior with methods and associated functions.

Start lesson
Challenge

Structs and Methods Practice

Practice defining structs, choosing method receivers, and building small stateful models.

Start lesson
Project

Wallet Ledger Build

Combine syntax, ownership, and structs into one guided CLI build before moving into richer Rust control flow.

Start lesson
Theory

Enums and Pattern Matching in Rust

Represent mutually exclusive states safely and use match to write explicit branching logic.

Start lesson
Challenge

Enums and Pattern Matching Practice

Practice enums and pattern matching through a small wallet manager exercise.

Start lesson
Theory

Collections and String Handling in Rust

Learn when to use vectors, maps, and strings, and how to work with them without fighting ownership.

Start lesson
Challenge

Collections and String Handling Practice

Use vectors, hash maps, and strings in realistic exercises that prepare you for program account data.

Start lesson