Skip to content
Codeforgeek
  • NodeJS MongoDB Rest API Course
  • Express.js
  • Node.js

“Knowledge is power.” – Francis Bacon

How to Use External Crates in Rust (Step-by-Step)

Rust / Aditya Gupta

Crates are Rust’s way of sharing reusable packages. You can use external crates to add functionality like random number generation, regex matching, or HTTP requests. Cargo makes it easy to include them in your project by adding them to your Cargo.toml file. When building something in Rust, you do not have to write everything from […]

How to Use External Crates in Rust (Step-by-Step) Read More »

Cargo Basics: Rust Package Manager

Rust / Aditya Gupta

Cargo is Rust’s official package manager and build tool. It handles everything from compiling your code, managing dependencies, running tests, and creating distributable packages. You use Cargo to create new projects and run them easily with simple commands. When I first started learning Rust, one of the best surprises was how smooth the experience was

Cargo Basics: Rust Package Manager Read More »

Organizing Code with Modules in Rust

Rust / Aditya Gupta

Modules in Rust help you organize code by grouping related functions, types, and constants together. You define modules using the mod keyword and use them to break large files into smaller, manageable pieces. As your Rust project grows, putting everything in one file becomes messy. That is where modules come in. They allow you to

Organizing Code with Modules in Rust Read More »

Unrecoverable Errors in Rust: Using panic! Safely

Rust / Aditya Gupta

Rust treats most errors as recoverable using the Result type. But for serious, unrecoverable failures like bugs in logic or unsafe conditions, you use the panic! macro. It immediately stops the program and prints a message. Rust is designed to help you write safe, reliable code. Most of the time, it encourages handling errors through

Unrecoverable Errors in Rust: Using panic! Safely Read More »

Error Handling with Result: Propagating Failures Safely

Rust / Aditya Gupta

Rust handles recoverable errors using the Result type, which represents either Ok(T) for success or Err(E) for failure. This pattern forces you to handle errors explicitly, avoiding silent failures or panics. Instead of crashing your program or hiding errors, Rust makes you deal with them. This is not just for safety, but also makes your

Error Handling with Result: Propagating Failures Safely Read More »

The Option Type: Null Safety in Rust

Rust / Aditya Gupta

Rust does not have null values. Instead, it uses the Option type to represent values that may or may not exist. Option is an enum with two variants: Some(T) for a value, and None for the absence of a value. Null values cause many runtime bugs in other languages. Rust solves this by replacing null

The Option Type: Null Safety in Rust Read More »

Pattern Matching with Enums in Rust

Rust / Aditya Gupta

Pattern matching with enums lets you destructure each variant and safely handle every possibility. Using the match expression, Rust forces you to deal with all cases, which helps prevent logic errors and unexpected behavior. In Rust, pattern matching is how you interact with enums effectively. It gives you fine control over what each variant means

Pattern Matching with Enums in Rust Read More »

Enums: Defining Variant Types in Rust

Rust / Aditya Gupta

An enum in Rust is a type that can represent one of several possible variants, each optionally holding different types of data. Enums are ideal for modeling choices, states, or patterns like Option, Result, and more. If structs in Rust let you group fields together, enums let you define a type that can be only

Enums: Defining Variant Types in Rust Read More »

Methods and Associated Functions in Rust

Rust / Aditya Gupta

A method in Rust is a function defined inside an impl block for a struct. It operates on an instance of the struct using self. An associated function is similar, but it does not take self and is often used as a constructor or helper. Once you start working with structs, you will want to

Methods and Associated Functions in Rust Read More »

Structs: Defining Custom Data Types in Rust

Rust / Aditya Gupta

A struct in Rust is a way to create a custom data type with named fields. Structs group related data together and give it structure. They are similar to JavaScript objects, but their fields and types must be explicitly declared. Structs are essential when you want to represent real-world entities in your Rust programs. Instead

Structs: Defining Custom Data Types in Rust Read More »

1 2 … 113 Next →

Recent Posts

  • How to Use External Crates in Rust (Step-by-Step)
  • Cargo Basics: Rust Package Manager
  • Organizing Code with Modules in Rust
  • Unrecoverable Errors in Rust: Using panic! Safely
  • Error Handling with Result: Propagating Failures Safely

Favorite Sites

  • Python Tutorials
  • GoLang Tutorials
  • VM-Help
  • Linux Tutorials
  • MySQL Tutorials
Copyright © 2025 CodeForGeek · All Rights Reserved
Privacy Policy · Advertize · Contact Us · About
CodeForGeek is part of JournalDev IT Services Private Limited