M Logo
← All tutorials

Rust for Beginners

Learn Rust from zero: install Rust, Cargo, variables, ownership, structs, enums, traits, closures, testing and a CLI to-do app.

Part 1

Install Rust on Ubuntu Linux with rustup and VS Code

Rust for Beginners, episode 1: Install Rust on Ubuntu Linux with rustup and VS Code. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustcargo

Part 2

Rust Cargo Tutorial: cargo new, cargo build and cargo run Explained

Rust for Beginners, episode 2: Rust Cargo Tutorial: cargo new, cargo build and cargo run Explained. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustcargo

Part 3

Rust Variables Explained: mut, const, Shadowing and Data Types

Rust for Beginners, episode 3: Rust Variables Explained: mut, const, Shadowing and Data Types. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust variablesrust data typesrust mutrust construst shadowingrust i32rust tuplerust arrayrust immutablecargorust languageLCElearn coding easily

Part 4

Rust Functions Explained: Parameters, Return Values and Error E0308

Rust for Beginners, episode 4: Rust Functions Explained: Parameters, Return Values and Error E0308. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust functionsrust fnrust parametersrust return valuerust return typerust expressionsrust statementsrust semicolonE0308cargorust languageLCElearn coding easily

Part 5

Rust if / else Explained: Conditions, else if and if as an Expression

Rust for Beginners, episode 5: Rust if / else Explained: Conditions, else if and if as an Expression. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust if elserust ifrust else ifrust conditionsrust if expressionrust ternaryrust boolE0308mismatched typescargorust languageLCElearn coding easily

Part 6

Rust Loops Explained: loop, while, for and Ranges

Rust for Beginners, episode 6: Rust Loops Explained: loop, while, for and Ranges. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust loopsrust looprust whilerust for looprust rangerust breakrust continuerust revrust arraycargorust languageLCElearn coding easily

Part 7

Rust Ownership Explained: Move, Clone and Scope

Rust for Beginners, episode 7: Rust Ownership Explained: Move, Clone and Scope. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust ownershiprust moverust clonerust copyrust scoperust stringborrow of moved valueE0382E0425rust memory safetycargorust languageLCElearn coding easily

Part 8

Rust Borrowing and References Explained: & and &mut, E0499, E0502

Rust for Beginners, episode 8: Rust Borrowing and References Explained: & and &mut, E0499, E0502. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust borrowingrust referencesrust borrow checkerrust &mutmutable referenceE0499E0502E0596E0106dangling referencerust ownershipcargorust languageLCElearn coding easily

Part 9

Rust Slices and String vs &str Explained

Rust for Beginners, episode 9: Rust Slices and String vs &str Explained. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust slicesrust string vs strrust &strstring slicerust Stringrust array slicerust borrow checkerE0502rust referencescargorust languageLCElearn coding easily

Part 10

Rust Structs Explained: Update Syntax, Tuple Structs, derive(Debug)

Rust for Beginners, episode 10: Rust Structs Explained: Update Syntax, Tuple Structs, derive(Debug). Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust structsrust structrust derive debugstruct update syntaxfield init shorthandtuple structE0594E0277rust custom typescargorust languageLCElearn coding easily

Part 11

Rust Methods and impl Explained: &self, &mut self, Associated Functions

Rust for Beginners, episode 11: Rust Methods and impl Explained: &self, &mut self, Associated Functions. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust methodsrust implrust selfrust &mut selfassociated functionrust struct methodsE0596rust Selfcargorust languageLCElearn coding easily

Part 12

Rust Enums and match Explained: Variants, Data, Exhaustive Matching

Rust for Beginners, episode 12: Rust Enums and match Explained: Variants, Data, Exhaustive Matching. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust enumsrust enumrust matchpattern matchingrust match expressionnon-exhaustive patternsE0004rust wildcardenum with datacargorust languageLCElearn coding easily

Part 13

Rust Option Explained: Some, None, if let, unwrap_or – No null in Rust

Rust for Beginners, episode 13: Rust Option Explained: Some, None, if let, unwrap_or – No null in Rust. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust optionrust some nonerust nullrust if letrust unwrapunwrap_orrust match optionE0369rust paniccargorust languageLCElearn coding easily

Part 14

Rust Error Handling Explained: Result, the ? Operator, panic! and expect

Rust for Beginners, episode 14: Rust Error Handling Explained: Result, the ? Operator, panic! and expect. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust error handlingrust resultrust question mark operatorrust panicrust expectrust unwraprust parseParseIntErrorrust Ok Errcargorust languageLCElearn coding easily

Part 15

Rust Vectors Explained: Vec, push, get, Loops and the Borrow Trap

Rust for Beginners, episode 15: Rust Vectors Explained: Vec, push, get, Loops and the Borrow Trap. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust vectorsrust vecrust vec pushrust vec getindex out of boundsrust iterate vectorrust borrow checkerE0502rust collectionscargorust languageLCElearn coding easily

Part 16

Rust HashMap Explained: insert, get, entry and Counting Words

Rust for Beginners, episode 16: Rust HashMap Explained: insert, get, entry and Counting Words. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust hashmaprust hash maprust hashmap entryor_insertrust collectionsrust word countrust key valuerust get optioncargorust languageLCElearn coding easily

Part 17

Rust Modules and Crates Explained: mod, pub, use and cargo add

Rust for Beginners, episode 17: Rust Modules and Crates Explained: mod, pub, use and cargo add. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust modulesrust modrust pubrust userust cratescargo addcrates.iorust colored craterust module filerust E0603rust languageLCElearn coding easily

Part 18

Rust Traits Explained: impl for, &impl Trait, Default Methods, derive

Rust for Beginners, episode 18: Rust Traits Explained: impl for, &impl Trait, Default Methods, derive. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust traitsrust traitimpl traitrust impl forrust default methodrust deriverust display traitrust E0046partialeqrust languageLCElearn coding easily

Part 19

Rust Generics and Lifetimes Explained: Generic T, Trait Bounds and 'a

Rust for Beginners, episode 19: Rust Generics and Lifetimes Explained: Generic T, Trait Bounds and 'a. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust genericsrust lifetimesrust trait boundspartialordrust generic structrust E0106rust E0597rust E0369rust languageLCElearn coding easily

Part 20

Rust Closures and Iterators Explained: map, filter, collect and sum

Rust for Beginners, episode 20: Rust Closures and Iterators Explained: map, filter, collect and sum. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust closuresrust iteratorsrust maprust filterrust collectrust iterrust enumeraterust lazy iteratorsrust languageLCElearn coding easily

Part 21

Rust Testing Explained: cargo test, assert_eq!, assert! and should_panic

Rust for Beginners, episode 21: Rust Testing Explained: cargo test, assert_eq!, assert! and should_panic. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust testingcargo testrust unit testsrust assert_eqrust assertrust should_panicrust cfg testrust libraryrust languageLCElearn coding easily

Part 22

Build a Rust CLI To-Do App: structs, enums, match, Result and Files

Rust for Beginners, episode 22: Build a Rust CLI To-Do App: structs, enums, match, Result and Files. Full code and every step, ready to copy.

rustrust programmingrust tutorialrust for beginnerslearn rustrust projectrust cli apprust todo apprust command linerust env argsrust read filerust write filerust beginner projectrust languageLCElearn coding easily

© 2026 All Rights Reserved By Mahmudul Alam