Skip to content

Rust Learning Journey - A comprehensive collection of Rust programming examples, projects, and concepts from basics to advanced topics. Perfect for beginners learning systems programming.

Notifications You must be signed in to change notification settings

raushan728/Rust-language-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Learning Journey

This repository contains my complete Rust learning journey — from basics to advanced projects.

Table of Contents

What is Rust?

Rust is a modern systems programming language focused on speed, safety, and concurrency — without using a garbage collector.

It is used to build fast and reliable software like operating systems, games, web servers, and more.

Rust Installation Guide

Install Rust (All Platforms)

Open your terminal or command prompt and run:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

This will install:

  • rustc → Rust compiler
  • cargo → Build tool and dependency manager
  • rustup → Toolchain manager

After installation, restart your terminal and check versions:

rustc --version
cargo --version

Install GCC (Required for Rust Compilation)

Rust needs a C compiler like GCC to compile some libraries.

  • Windows:

    • Download and install MinGW-w64
    • During installation, choose:
      • Architecture: x86_64
      • Threads: posix
      • Exception: seh
    • Add the bin folder (e.g., C:\Program Files\mingw-w64\...\bin) to your System PATH
  • Linux (Ubuntu/Debian):

    sudo apt update
    sudo apt install build-essential
  • macOS:

    xcode-select --install

Project Structure

Rust-Language-/
│
├── Individual Concept Files (e.g., 01_main.rs, 03_variables.rs, etc.)  # Single .rs files for learning basics
│
├── 02_guess_game/              # Cargo project: Number guessing game
│   ├── Cargo.toml
│   └── src/
│       └── main.rs
│
├── 16_rust_package_demo/       # Cargo project: Library demo
│   ├── Cargo.toml
│   ├── Cargo.lock
│   └── src/
│       ├── lib.rs
│       └── main.rs
│
├── 18_project/                 # Cargo project: Bank account simulation
│   ├── Cargo.toml
│   ├── Cargo.lock
│   └── src/
│       ├── lib.rs
│       ├── main.rs
│       └── bank/
│           ├── mod.rs
│           └── account.rs
│
└── README.md                   # This file

How to Run Code

Run Single .rs File

For individual .rs files (e.g., 01_main.rs):

rustc <filename>.rs
./<filename>       # On Linux/Mac
<filename>.exe     # On Windows

Example:

rustc 01_main.rs
./01_main

Run Cargo Project

For Cargo-based projects (e.g., 02_guess_game):

cd <project-folder>
cargo run

To build without running:

cargo build

To build in release mode:

cargo build --release

Example for 02_guess_game:

cd 02_guess_game
cargo run

Topics Covered

This repository covers key Rust concepts through individual files and projects:

  • Hello World and Basics (01_main.rs)
  • Variables and Constants (03_variables.rs)
  • Data Types, Arrays, Tuples (04_DataTypes.rs)
  • Functions (05_Functions.rs)
  • Control Flow (06_Control_flow.rs)
  • Ownership (07_Ownership.rs)
  • References and Borrowing (08_References_and_Borrowing.rs)
  • The Slice Type (09_The_Slice.rs)
  • Structs (10_struct.rs, 11_dbgMacro_Defining_and_Instantiating_Structs.rs, 12_Method_Syntax.rs)
  • Enums and Match (13_The_Enum_and_Match_Types.rs, 14_Match_Control_flow.rs)
  • Concise Control Flow (15_Let_if_Concise_Flow.rs)
  • Modules (17_Defining_Modules_to_Control_Scope.rs)
  • Vectors (19_Storing_Lists_of_Values_with_Vectors.rs)
  • Strings (20_String_operation.rs)
  • Hash Maps (21_Storing_Keys_with_Associated_Values_in_Hash_Maps.rs)
  • Error Handling (22_error_with_panic.rs, 23_Recoverable_Errors_with_Result.rs)
  • Traits (24_Traits.rs)
  • Lifetimes (25_Validating_References_with_Lifetimes.rs)
  • Projects: Guessing Game (02_guess_game), Package Demo (16_rust_package_demo), Bank Account (18_project)

Resources

About

Rust Learning Journey - A comprehensive collection of Rust programming examples, projects, and concepts from basics to advanced topics. Perfect for beginners learning systems programming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages