The Rust Borrow Checker Mental Model
Ownership, borrowing, lifetimes. Three ideas. If you've been fighting the compiler, you're missing one of them.
Borrow checker, lifetimes, async, error patterns. Mental models for moving past the fight.
Ownership, borrowing, lifetimes. Three ideas. If you've been fighting the compiler, you're missing one of them.
Library code uses thiserror. Application code uses anyhow. Standard library uses Result. Each fills a real role.
Futures are state machines. Tokio runs them. Send + Sync make the whole thing safe across threads.
A lifetime is a region of code where a reference is valid. The compiler is just checking that math.
Iterators are lazy. Closures are anonymous functions with captured state. Combined, they outperform manual loops.