Rust Programming Language

From Script | Spoken-Tutorial
Revision as of 18:26, 13 October 2025 by Nirmala Venkat (Talk | contribs)

Jump to: navigation, search

Rust is an advanced systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. Rust is designed to be safe and concurrent. It achieves memory safety without using garbage collection and is known for its rich type system and ownership model which guarantee memory-safety and thread-safety.

Rust combines the speed and control of languages like C and C++ with strong safety guarantees that prevent many common programming errors (like null pointer dereferencing and data races). It combines low-level control over hardware with high-level abstractions, enabling developers to write reliable and efficient software.

The contributor who helped to create the outline, content, code is Vishal Pokuri from VIT Vellore. The Spoken Tutorial Effort for Rust Programming language is being contributed by Ms. Nirmala Venkat, Ms.Ketki Bhamble and Ms. Madhuri Ganapathi from Spoken Tutorial project, IIT Bombay.


Contents

Basic Level

1. Installation of Rust on Linux

  • About Rust
  • Installation of Rust on Linux
  • Check for Curl installation
  • Install modules and packages like cargo, rustfmt, clippy
  • Set up an Integrated Development Environment(IDE)
  • Install Visual Studio Code
  • Install rust-analyzer
  • Verify the version after installation is done
  • About Rust compiler and Tool Chain Manager
  • Write and compile a Hello world program

2. Hello World using Cargo

  • About Cargo
  • About Cargo commands
  • Create a Rust project using Visual Studio code
  • Add a program in main.rs
  • Explore Rust program structure
  • Save the program
  • Build the Rust program
  • Run the Rust program
  • Check the output
  • Edit the program and re-run the program

3.Variables and Mutability

  • Variables in Rust
  • Mutabilty in Rust
  • Mutable variable with example
  • Shadowing of variables
  • Scope of variables

4.Data Types

  • Data types in Rust
  • Scalar Data type with example
  • Constants
  • Type Inference in Rust

5.Control Flow

  • Control Flow Statement
  • if
  • else if
  • else
  • loop
  • for loop
  • while loop

6.Functions

  • Functions in Rust
  • Declare a Function
  • Passing parameters to a Function
  • Function with return value
  • Examples

7.Enums

  • Enums in Rust
  • Variants in Rust
  • Explain with example

8.Pattern Matching

  • About Pattern matching
  • Match statement with example
  • About Option and Result enum types
  • Matching Option Type with example
  • Result enum type with example

9.Pattern Types

  • Pattern types in rust
  • Irrefutable pattern
  • refutable pattern
  • if let expression with example
  • while let expression with example

10.Arrays

  • Arrays in Rust
  • Array Index
  • Mutable Array
  • Different methods used in arrays

11. Tuples and Struct

  • About Tuples
  • Example for Tuples
  • Destructuring Tuples
  • About Rust struct or structures
  • Example for Struct

12.Strings

  • About String data type
  • String Literal
  • String Slice
  • String Objects
  • common methods used with string objects

13.Ownership

  • About Ownership
  • Ownership Rules
  • Drop and Copy traits
  • Example for Drop trait
  • Example for Copy trait

14. Borrowing

  • About Borrowing
  • Rules of Borrowing
  • Example for rules of Borrowing
  • Dangling reference with example

15. Collections

  • Collections
  • Types of Collections
  • Vectors with example
  • HashMap with example
  • HashSet with example

Contributors and Content Editors

Nirmala Venkat