Skip to content

kamallearner123/APTRUSTNOV12

Repository files navigation

[APTRUSTNOV12] - Rust Programming Essentials

Rust Programming Course (Level – 1)

  • Trainer: Kamal Kumar Mukiri (@acl)
  • Time: 8:00 PM to 9:30 PM (IST)
  • Dates: November 11, 2024, to December 12, 2024
  • Schedule: Monday to Thursday (20 sessions)
  • Location: Online (Google Meet)

Welcome to the Rust Programming Essentials course! This course is designed to provide a comprehensive foundation in Rust programming, covering everything from basic syntax to advanced topics like error handling, memory safety, and concurrency.

Course Overview

Rust Programming Essentials is a hands-on course that will guide you through the fundamental concepts of Rust. By the end of this course, you'll have a strong foundation in Rust programming and be able to build applications that leverage Rust's performance and safety benefits.

Course Objectives

  • Understand Rust’s core features and unique design philosophy.
  • Learn about ownership, borrowing, and lifetimes for safe memory management.
  • Master Rust's error handling mechanisms.
  • Explore advanced topics like concurrency, async programming, and traits.

Prerequisites

  • Basic knowledge of programming concepts.
  • Familiarity with a language like C/C++ or Python is recommended but not required.
  • Access to a computer with Rust installed (instructions provided in Module 1).

Who is This Course For?

This course is ideal for:

  • Developers who want to learn Rust from scratch.
  • Programmers interested in systems programming and safe memory management.
  • Anyone interested in understanding how Rust prevents common programming errors.

Course Modules

Comprehensive Rust Programming Course Outline

Module 1: Introduction to Rust

  • Topics: Installing Rust, basic syntax, cargo package manager, Hello World program.
  • Outcome: Set up a Rust development environment, navigate cargo, and understand Rust’s core syntax.
  • Testing: Unit and integration tests, test organization, assertions, and #[test] attributes.
  • Coverage: Code coverage with cargo-tarpaulin and other tools for tracking tested code.
  • Linting and Formatting: Using rustfmt, clippy, and cargo-audit for linting and code quality.

Module 2: Variables, Data Types, and Basic Operations

  • Topics: Primitive types, mutability, constants, shadowing, type inference, basic arithmetic, and string manipulation.
  • Outcome: Work with Rust's data types, understand mutability, and manipulate data.

Module 3: Ownership, Borrowing, and Lifetimes

  • Topics: Ownership rules, borrowing, references, slice types, lifetimes, and the borrow checker.
  • Outcome: Grasp Rust's memory model to avoid memory issues and optimize data management.

Module 4: Control Flow and Pattern Matching

  • Topics: if statements, loops (for, while, loop), match expressions, destructuring, and if let / while let patterns.
  • Outcome: Implement complex control flows and leverage Rust’s pattern-matching capabilities for clean code.

Module 5: Functions, Closures, and Error Handling

  • Topics: Function definitions, closures, capturing environment variables, error handling with Result and Option, and early returns.
  • Outcome: Write reusable functions, work with closures, and handle errors effectively.

Module 6: Structs, Enums, and Pattern Matching in Depth

  • Topics: Structs, tuple structs, enums, pattern matching with structs and enums, option types, and Result-based pattern matching.
  • Outcome: Model complex data structures and perform advanced pattern matching for cleaner code.

Module 7: Collections, Iterators, and Functional Programming

  • Topics: Vectors, hash maps, strings, iterators, combinators (map, filter, fold, collect), and ownership within collections.
  • Outcome: Manipulate data in collections efficiently and apply functional programming concepts in Rust.

Module 8: Traits, Generics, and Smart Pointers

  • Topics: Traits, generic types, lifetimes with generics, Box, Rc, Arc, and RefCell.
  • Outcome: Create reusable, flexible code using generics and smart pointers, enabling ownership of complex data structures.

Module 9: Concurrency and Asynchronous Programming

  • Topics: Threads, std::sync (Mutex, Channels), async/await, async functions, futures, and asynchronous error handling.
  • Outcome: Write concurrent and asynchronous code in Rust for high-performance applications.

Module 10: Advanced Topics and Tools in Rust

  • Topics: unsafe Rust, raw pointers, macros, procedural macros, low-level programming.
  • Outcome: Explore advanced Rust features and gain understanding of low-level programming concepts.

Module 11: Cargo Tools, Testing, and Advanced Rust Tools

  • Topics:
    • Cargo Tools: Using cargo subcommands, workspace management, dependency management, and release profiles.
    • Miri: Running Miri to detect undefined behavior and perform safe checks.
    • Benchmarking and Profiling: Performance analysis using cargo bench and other profiling tools.
  • Outcome: Master Cargo’s powerful features, write thorough tests, analyze code coverage, and use tools like Miri for secure code, making projects robust and production-ready.

This course outline takes learners through foundational to advanced Rust programming topics and tools, preparing them for building high-quality, robust applications.



Beginner Level

1. CLI To-Do App

  • Description: A command-line to-do list manager to add, edit, delete, and view tasks.
  • Modules: std::fs, std::io
  • Key Features: Data storage in text or JSON files, user-friendly CLI.

2. Temperature Converter

  • Description: A CLI app to convert temperatures between Fahrenheit, Celsius, and Kelvin.
  • Modules: std::io
  • Key Features: Data input/output, temperature formula calculations.

3. Basic Web Scraper

  • Description: Extract specific information from a webpage.
  • Modules: reqwest, scraper
  • Key Features: Fetch HTML, parse elements using CSS selectors.

4. Markdown to HTML Converter

  • Description: Converts Markdown text to HTML format.
  • Modules: regex, pulldown-cmark
  • Key Features: Support for headers, lists, and inline formatting.

5. Unit Converter

  • Description: CLI app to convert units of length, weight, and volume.
  • Modules: std::io
  • Key Features: Enums for unit types, conversion formulas.

6. Command-Line Calculator

  • Description: A CLI calculator for basic math operations.
  • Modules: std::io
  • Key Features: Parsing input, handling arithmetic errors.

7. Number Guessing Game

  • Description: A number guessing game that gives hints to the user.
  • Modules: rand, std::io
  • Key Features: Random number generation, user interaction.

Intermediate Level

8. Weather App

  • Description: A CLI app that fetches weather data for a specified location.
  • Modules: reqwest, serde_json
  • Key Features: API integration, JSON parsing, CLI.

9. File Organizer

  • Description: Sorts files into folders by type or date.
  • Modules: std::fs, chrono
  • Key Features: File type recognition, date-based sorting.

10. Chat Application

  • Description: A TCP-based chat app where clients can communicate.
  • Modules: std::net, tokio
  • Key Features: TCP sockets, async message handling.

11. REST API with Actix-Web

  • Description: A REST API server for a to-do list or notes app.
  • Modules: actix-web, serde, serde_json
  • Key Features: CRUD operations, JSON serialization.

12. Image Manipulation Tool

  • Description: Tool to resize, crop, or grayscale images.
  • Modules: image
  • Key Features: Image processing, command-line options.

13. URL Shortener

  • Description: Shortens URLs and stores them in a database.
  • Modules: actix-web, serde, sqlite
  • Key Features: API for URL shortening, database interaction.

14. Text-Based Adventure Game

  • Description: A game where players navigate rooms, collect items, and solve puzzles.
  • Modules: std::io
  • Key Features: Structs and enums for game elements, CLI interaction.

15. Password Manager

  • Description: CLI tool for storing and retrieving encrypted passwords.
  • Modules: std::fs, ring, rpassword
  • Key Features: Encryption, password hashing, secure file storage.

Advanced Level

16. Search Engine for Text Files

  • Description: Indexes text files and allows keyword-based searches.
  • Modules: std::fs, regex, rayon
  • Key Features: Parallel file processing, regex for text matching.

17. Blockchain Implementation

  • Description: Basic blockchain with block validation.
  • Modules: ring, serde, chrono
  • Key Features: Cryptographic hashing, chain validation.

18. Compiler for a Simple Language

  • Description: Compiler with lexer, parser, and basic evaluation.
  • Modules: logos, nom
  • Key Features: Tokenization, syntax parsing, code generation.

19. File Synchronization Tool

  • Description: Syncs files across folders or devices.
  • Modules: std::fs, chrono
  • Key Features: File comparison, sync algorithms.

20. Concurrency Task Scheduler

  • Description: Job scheduler that runs multiple tasks concurrently.
  • Modules: tokio, std::sync
  • Key Features: Task scheduling, async execution.


Getting Started

  1. Clone the Repository:
    git clone https://github.com/your-username/rust-programming-essentials.git
    cd rust-programming-essentials

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published