explaingit

pretzelhammer/rust-blog

8,359RustAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A personal blog of educational articles for Rust learners, tackling the concepts that trip people up most, lifetimes, traits, memory sizing, plus practical guides for building REST APIs and chat servers in Rust.

Mindmap

mindmap
  root((rust-blog))
    Key topics
      Lifetime misconceptions
      Standard traits
      Memory sizing
    Practical guides
      REST API in Rust
      Multithreaded chat
      Rust in other servers
    Audience
      Rust beginners
      Intermediate learners
    Community
      Translations
      Pull requests welcome
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Fix incorrect mental models about Rust lifetimes by reading the dedicated misconceptions article.

USE CASE 2

Follow the practical guide to build a REST API in Rust from scratch.

USE CASE 3

Study Rust's standard library traits to understand what built-in behaviors your types can implement.

Tech stack

RustMarkdown

Getting it running

Difficulty · easy Time to first run · 5min
Code examples are dual-licensed MIT and Apache 2.0, use them freely in any project. The English prose articles are the author's exclusive copyright.

In plain English

This repository is a personal blog containing educational articles about the Rust programming language. The author writes for people who are new to Rust or who have gotten past the basics but still find some of the harder concepts confusing. All the posts are stored as Markdown files in the repository itself, which means anyone can read them directly on GitHub or propose corrections through pull requests. The post list covers topics that Rust learners commonly struggle with. The most widely read article is about Rust lifetime misconceptions, which addresses a set of incorrect mental models that beginners often carry into the language. Other popular posts cover Rust's standard library traits (the built-in behaviors that types can implement), how to think about memory sizing in Rust, and practical guides on building a REST API and a multithreaded chat server. There are also posts aimed at someone deciding whether to learn Rust and how to approach that learning. A 2024 post covers how to use Rust code inside servers written in other languages to speed up specific performance-critical parts, without rewriting the entire server. This is a more advanced topic for developers already working in other languages who want targeted gains. Several posts have been translated into Chinese, Japanese, Russian, and Turkish by community volunteers. The author accepts pull requests for translations and hosts them directly in the repository. Code examples in the posts are dual-licensed under Apache 2.0 and MIT. The author keeps exclusive rights to the English prose of the posts themselves. You can subscribe to new post notifications via the repository's RSS releases feed or by watching the repo for new releases on GitHub.

Copy-paste prompts

Prompt 1
I just read pretzelhammer's Rust lifetime misconceptions article. Give me 5 short code examples that show how the Rust compiler infers lifetimes in function signatures via elision rules.
Prompt 2
Based on pretzelhammer's REST API in Rust guide, show me how to add JWT authentication middleware to an Actix-web handler so only signed-in users can call a protected route.
Prompt 3
Walk me through implementing Display, From, and Iterator for a custom Rust type, with runnable examples, in the style of pretzelhammer's trait explanations.
Prompt 4
I read pretzelhammer's Sizedness in Rust post. Explain in plain terms why you need Box<dyn Trait> instead of a plain dyn Trait in a Vec, and show a minimal working example.
Open on GitHub → Explain another repo

← pretzelhammer on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.