Back to Modules
Rust Foundations

Learning Module

Rust Foundations

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

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

Rust Foundations

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

Theory

Rust Setup and Core Syntax

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

Challenge

Rust Syntax Practice

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

Theory

Ownership and Borrowing

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

Challenge

Ownership and Borrowing Practice

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

Theory

Structs and Methods

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

Challenge

Structs and Methods Practice

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

Project

Wallet Ledger Build

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

Theory

Enums and Pattern Matching in Rust

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

Challenge

Enums and Pattern Matching Practice

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

Theory

Collections and String Handling in Rust

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

Challenge

Collections and String Handling Practice

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