Skip to content

arunjot12/RustCodePlayground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

96 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Rust Code Playground

A collection of Rust programs demonstrating various concepts and features of the Rust programming language. This repository is ideal for learners and enthusiasts looking to explore Rust through hands-on examples.

๐Ÿ“ Folder Structure

The codebase is organized into folders, each focused on different aspects of Rust programming:

๐Ÿ”น basic/

Contains beginner-friendly programs that cover:

  • Input/output handling
  • Basic control flow (if/else, loops)
  • Variable declaration and data types

๐Ÿ”น rust_topics/

Covers core Rust topics such as:

  • Ownership and Borrowing
  • Structs and Enums
  • Traits and Implementations
  • Pattern Matching
  • Error handling (Result, Option)

๐Ÿ”น arrays/

Includes examples related to:

  • Array and Vector usage
  • Iterating over collections
  • Array manipulation techniques

Each folder includes multiple .rs files with self-contained Rust programs.

๐Ÿ”น memory_management/

Covers memory handling and low-level behavior in Rust:

  • Stack vs Heap: How Rust decides where to allocate memory and the implications of each.
  • Memory Allocation: Using Box, Rc, and smart pointers to allocate memory on the heap and share ownership.
  • Lifetimes: Ensuring memory safety at compile time through lifetime annotations.
  • Threads & Concurrency:
    • Spawning and managing threads using std::thread
    • Sharing memory safely between threads using Arc and Mutex
    • Demonstrating Rustโ€™s fearless concurrency model

๐Ÿš€ Getting Started

Make sure you have Rust installed.

Clone the repository:

git clone https://github.com/arunjot12/Rust_programs.git
cd Rust_programs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages