Part 1: Getting Started with Rust - Setting Up and Basic Types
Introduction
Why Rust for a Security Tool?
My Decision Process
Installing Rust
macOS/Linux
Windows
Update Rust
Creating the Project
Initial Setup
Cargo.toml - Project Manifest
Building and Running
Basic Rust Types in My Project
Primitive Types
Strings in Rust
Collections
Vectors - Dynamic Arrays
HashMaps - Key-Value Storage
Enums - Core to Rust
Simple Enums
Enums with Data
Option - Handling Null
Structs - Building Data Models
Basic Structs
Structs with Derive Macros
Reading JSON into Structs
Pattern Matching - Rust's Superpower
Matching Enums
Matching with Guards
Destructuring
Result Type - Error Handling
Basic Result Usage
The ? Operator
? OperatorReal Example: WAF Detection Structure
Common Patterns I Use
Builder Pattern
Iterator Chains
Build and Test
Creating a Simple Binary
Building
Key Takeaways
Common Beginner Mistakes I Made
String Confusion
Forgetting mut
Not Handling Results
Next in Series
Last updated