A comprehensive guide to the Rust programming language, from ownership, data structures, and error handling through concurrency, smart pointers, and building real programs such as command-line tools and a multithreaded web server. Aimed at developers who want memory safety without giving up performance.
This page is free — overview and chapter list only.
The complete book body is sold separately.
Full book: $2.99 USDC via x402 ·
Per chapter: $0.25 USDC
Buy / open complete book (HTML)
· Complete book Markdown (.md)
Agents: start with free /library/discovery.json, sample free teaser chapters,
then pay for individual chapters or the complete book URL above.
Append .md to any content URL for Markdown with YAML front matter.
Chapters
- Who Rust Is For (Free teaser)
- How To Use This Book ($0.25)
- Hello World ($0.25)
- Hello Cargo ($0.25)
- Summary ($0.25)
- Using A Crate To Get More Functionality ($0.25)
- Generating A Random Number ($0.25)
- Handling Invalid Input ($0.25)
- Compound Types ($0.25)
- If Expressions ($0.25)
- What Is Ownership ($0.25)
- The String Type ($0.25)
- References And Borrowing ($0.25)
- The Slice Type ($0.25)
- Defining And Instantiating Structs ($0.25)
- An Example Program Using Structs ($0.25)
- Method Syntax ($0.25)
- Defining An Enum ($0.25)
- The Match Control Flow Operator ($0.25)
- Mod And The Filesystem ($0.25)
- Controlling Visibility With Pub ($0.25)
- Referring To Names In Different Modules ($0.25)
- Storing Lists Of Values With Vectors ($0.25)
- Using An Enum To Store Multiple Types ($0.25)
- Appending To A String With Pushstr And Push ($0.25)
- Updating A Hash Map ($0.25)
- Unrecoverable Errors With Panic ($0.25)
- Recoverable Errors With Result ($0.25)
- To Panic Or Not To Panic ($0.25)
- In Struct Definitions ($0.25)
- Performance Of Code Using Generics ($0.25)
- Default Implementations ($0.25)
- Using Trait Bounds To Conditionally Implement Methods ($0.25)
- Lifetime Annotations In Function Signatures ($0.25)
- Lifetime Elision ($0.25)
- How To Write Tests ($0.25)
- Running A Subset Of Tests By Name ($0.25)
- Integration Tests ($0.25)
- Saving The Argument Values In Variables ($0.25)
- Fixing The Error Handling ($0.25)
- Extracting Logic From Main ($0.25)
- Writing A Failing Test For The Case Insensitive Search Funct ($0.25)
- Creating An Abstraction Of Behavior With Closures ($0.25)
- Storing Closures Using Generic Parameters And The Fn Traits ($0.25)
- Capturing The Environment With Closures ($0.25)
- Creating Our Own Iterators With The Iterator Trait ($0.25)
- Making Code Clearer With Iterator Adaptors ($0.25)
- Exporting A Convenient Public Api With Pub Use ($0.25)
- Adding Metadata To A New Crate ($0.25)
- Cargo Workspaces ($0.25)
- Using Box To Point To Data On The Heap ($0.25)
- Treating Smart Pointers Like Regular References With The Der ($0.25)
- Running Code On Cleanup With The Drop Trait ($0.25)
- Rc The Reference Counted Smart Pointer ($0.25)
- Refcell And The Interior Mutability Pattern ($0.25)
- Preventing Reference Cycles Turning An Rc Into A Weak ($0.25)
- Using Move Closures With Threads ($0.25)
- Channels And Ownership Transference ($0.25)
- Using Mutexes To Allow Access To Data From One Thread At A T ($0.25)
- Implementing Send And Sync Manually Is Unsafe ($0.25)
- Inheritance As A Type System And As Code Sharing ($0.25)
- Implementing The Trait ($0.25)
- Object Safety Is Required For Trait Objects ($0.25)
- Trade Offs Of The State Pattern ($0.25)
- All The Places Patterns Can Be Used ($0.25)
- Pattern Syntax ($0.25)
- Unsafe Rust ($0.25)
- Advanced Lifetimes ($0.25)
- Advanced Traits ($0.25)
- Advanced Types ($0.25)
- Advanced Functions And Closures ($0.25)
- Building A Single Threaded Web Server ($0.25)
- Writing A Response ($0.25)
- Building The Threadpool Struct Using Compiler Driven Develop ($0.25)
- Implementing The Execute Method ($0.25)
- Signaling To The Threads To Stop Listening For Jobs ($0.25)
- Oper At Ors And Symbol S ($0.25)
- Clone And Copy For Duplicating Values ($0.25)
- Procedural Macros For Custom Derive ($0.25)
- The Future Of Macros ($0.25)