**The Rust Programming Language**

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

  1. Who Rust Is For (Free teaser)
  2. How To Use This Book ($0.25)
  3. Hello World ($0.25)
  4. Hello Cargo ($0.25)
  5. Summary ($0.25)
  6. Using A Crate To Get More Functionality ($0.25)
  7. Generating A Random Number ($0.25)
  8. Handling Invalid Input ($0.25)
  9. Compound Types ($0.25)
  10. If Expressions ($0.25)
  11. What Is Ownership ($0.25)
  12. The String Type ($0.25)
  13. References And Borrowing ($0.25)
  14. The Slice Type ($0.25)
  15. Defining And Instantiating Structs ($0.25)
  16. An Example Program Using Structs ($0.25)
  17. Method Syntax ($0.25)
  18. Defining An Enum ($0.25)
  19. The Match Control Flow Operator ($0.25)
  20. Mod And The Filesystem ($0.25)
  21. Controlling Visibility With Pub ($0.25)
  22. Referring To Names In Different Modules ($0.25)
  23. Storing Lists Of Values With Vectors ($0.25)
  24. Using An Enum To Store Multiple Types ($0.25)
  25. Appending To A String With Pushstr And Push ($0.25)
  26. Updating A Hash Map ($0.25)
  27. Unrecoverable Errors With Panic ($0.25)
  28. Recoverable Errors With Result ($0.25)
  29. To Panic Or Not To Panic ($0.25)
  30. In Struct Definitions ($0.25)
  31. Performance Of Code Using Generics ($0.25)
  32. Default Implementations ($0.25)
  33. Using Trait Bounds To Conditionally Implement Methods ($0.25)
  34. Lifetime Annotations In Function Signatures ($0.25)
  35. Lifetime Elision ($0.25)
  36. How To Write Tests ($0.25)
  37. Running A Subset Of Tests By Name ($0.25)
  38. Integration Tests ($0.25)
  39. Saving The Argument Values In Variables ($0.25)
  40. Fixing The Error Handling ($0.25)
  41. Extracting Logic From Main ($0.25)
  42. Writing A Failing Test For The Case Insensitive Search Funct ($0.25)
  43. Creating An Abstraction Of Behavior With Closures ($0.25)
  44. Storing Closures Using Generic Parameters And The Fn Traits ($0.25)
  45. Capturing The Environment With Closures ($0.25)
  46. Creating Our Own Iterators With The Iterator Trait ($0.25)
  47. Making Code Clearer With Iterator Adaptors ($0.25)
  48. Exporting A Convenient Public Api With Pub Use ($0.25)
  49. Adding Metadata To A New Crate ($0.25)
  50. Cargo Workspaces ($0.25)
  51. Using Box To Point To Data On The Heap ($0.25)
  52. Treating Smart Pointers Like Regular References With The Der ($0.25)
  53. Running Code On Cleanup With The Drop Trait ($0.25)
  54. Rc The Reference Counted Smart Pointer ($0.25)
  55. Refcell And The Interior Mutability Pattern ($0.25)
  56. Preventing Reference Cycles Turning An Rc Into A Weak ($0.25)
  57. Using Move Closures With Threads ($0.25)
  58. Channels And Ownership Transference ($0.25)
  59. Using Mutexes To Allow Access To Data From One Thread At A T ($0.25)
  60. Implementing Send And Sync Manually Is Unsafe ($0.25)
  61. Inheritance As A Type System And As Code Sharing ($0.25)
  62. Implementing The Trait ($0.25)
  63. Object Safety Is Required For Trait Objects ($0.25)
  64. Trade Offs Of The State Pattern ($0.25)
  65. All The Places Patterns Can Be Used ($0.25)
  66. Pattern Syntax ($0.25)
  67. Unsafe Rust ($0.25)
  68. Advanced Lifetimes ($0.25)
  69. Advanced Traits ($0.25)
  70. Advanced Types ($0.25)
  71. Advanced Functions And Closures ($0.25)
  72. Building A Single Threaded Web Server ($0.25)
  73. Writing A Response ($0.25)
  74. Building The Threadpool Struct Using Compiler Driven Develop ($0.25)
  75. Implementing The Execute Method ($0.25)
  76. Signaling To The Threads To Stop Listening For Jobs ($0.25)
  77. Oper At Ors And Symbol S ($0.25)
  78. Clone And Copy For Duplicating Values ($0.25)
  79. Procedural Macros For Custom Derive ($0.25)
  80. The Future Of Macros ($0.25)