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: $0.99 USDC via x402 ·
Per chapter: $0.10 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.10)
- Hello World ($0.10)
- Hello Cargo ($0.10)
- Summary ($0.10)
- Using A Crate To Get More Functionality ($0.10)
- Generating A Random Number ($0.10)
- Handling Invalid Input ($0.10)
- Compound Types ($0.10)
- If Expressions ($0.10)
- What Is Ownership ($0.10)
- The String Type ($0.10)
- References And Borrowing ($0.10)
- The Slice Type ($0.10)
- Defining And Instantiating Structs ($0.10)
- An Example Program Using Structs ($0.10)
- Method Syntax ($0.10)
- Defining An Enum ($0.10)
- The Match Control Flow Operator ($0.10)
- Mod And The Filesystem ($0.10)
- Controlling Visibility With Pub ($0.10)
- Referring To Names In Different Modules ($0.10)
- Storing Lists Of Values With Vectors ($0.10)
- Using An Enum To Store Multiple Types ($0.10)
- Appending To A String With Pushstr And Push ($0.10)
- Updating A Hash Map ($0.10)
- Unrecoverable Errors With Panic ($0.10)
- Recoverable Errors With Result ($0.10)
- To Panic Or Not To Panic ($0.10)
- In Struct Definitions ($0.10)
- Performance Of Code Using Generics ($0.10)
- Default Implementations ($0.10)
- Using Trait Bounds To Conditionally Implement Methods ($0.10)
- Lifetime Annotations In Function Signatures ($0.10)
- Lifetime Elision ($0.10)
- How To Write Tests ($0.10)
- Running A Subset Of Tests By Name ($0.10)
- Integration Tests ($0.10)
- Saving The Argument Values In Variables ($0.10)
- Fixing The Error Handling ($0.10)
- Extracting Logic From Main ($0.10)
- Writing A Failing Test For The Case Insensitive Search Funct ($0.10)
- Creating An Abstraction Of Behavior With Closures ($0.10)
- Storing Closures Using Generic Parameters And The Fn Traits ($0.10)
- Capturing The Environment With Closures ($0.10)
- Creating Our Own Iterators With The Iterator Trait ($0.10)
- Making Code Clearer With Iterator Adaptors ($0.10)
- Exporting A Convenient Public Api With Pub Use ($0.10)
- Adding Metadata To A New Crate ($0.10)
- Cargo Workspaces ($0.10)
- Using Box To Point To Data On The Heap ($0.10)
- Treating Smart Pointers Like Regular References With The Der ($0.10)
- Running Code On Cleanup With The Drop Trait ($0.10)
- Rc The Reference Counted Smart Pointer ($0.10)
- Refcell And The Interior Mutability Pattern ($0.10)
- Preventing Reference Cycles Turning An Rc Into A Weak ($0.10)
- Using Move Closures With Threads ($0.10)
- Channels And Ownership Transference ($0.10)
- Using Mutexes To Allow Access To Data From One Thread At A T ($0.10)
- Implementing Send And Sync Manually Is Unsafe ($0.10)
- Inheritance As A Type System And As Code Sharing ($0.10)
- Implementing The Trait ($0.10)
- Object Safety Is Required For Trait Objects ($0.10)
- Trade Offs Of The State Pattern ($0.10)
- All The Places Patterns Can Be Used ($0.10)
- Pattern Syntax ($0.10)
- Unsafe Rust ($0.10)
- Advanced Lifetimes ($0.10)
- Advanced Traits ($0.10)
- Advanced Types ($0.10)
- Advanced Functions And Closures ($0.10)
- Building A Single Threaded Web Server ($0.10)
- Writing A Response ($0.10)
- Building The Threadpool Struct Using Compiler Driven Develop ($0.10)
- Implementing The Execute Method ($0.10)
- Signaling To The Threads To Stop Listening For Jobs ($0.10)
- Oper At Ors And Symbol S ($0.10)
- Clone And Copy For Duplicating Values ($0.10)
- Procedural Macros For Custom Derive ($0.10)
- The Future Of Macros ($0.10)