{"product_id":"128648","title":"Rust Clean Code ","description":"\u003ccenter\u003e\u003cdiv style=\"text-align:center\"\u003e\u003cimg src=\"https:\/\/tmgdisk01.cafe24.com\/images\/vs\/4172\/sv\/3jX1PGHHeGeSvVo4xmVyNKt77v1Wgt.png?v=1765059162\" style=\"max-width:100%;max-height:10px\"\u003e\u003c\/div\u003e\u003c\/center\u003e\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\u003ccenter\u003e\n\n\u003cdiv style=\"width:95%\"\u003e\n\n\u003cdiv style=\"text-align:center;font-size:30px;font-weight:bolder;line-height:1.6em\"\u003e Rust Clean Code \u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"border-bottom:1px;border-bottom-style:dotted;border-color:;padding-bottom:20px\"\u003e\u003ccenter\u003e\u003ctable align=\"center\" width=\"100%\"\u003e\u003ctbody style=\"border:0px\"\u003e\n\n\u003ctr\u003e\u003ctd align=\"center\" style=\"line-height:1.2em;text-align:center;font-size:18px;color:black;font-weight:bold;padding-bottom:20px;\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\n\n\u003ctr\u003e\u003ctd style=\"text-align:center\"\u003e\u003cimg src=\"https:\/\/image.yes24.com\/goods\/153063596\/XL\" style=\"max-width:100%;height:auto\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\n\n\n\u003c\/tbody\u003e\u003c\/table\u003e\u003c\/center\u003e\u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"width:95%;{split_style6}padding-top:20px;padding-bottom:20px\"\u003e\n\n\u003cdiv style=\"text-align:left;font-size:16px;font-weight:bold;padding-bottom:20px\"\u003e Description \u003c\/div\u003e\n\n\u003cdiv style=\"text-align:left;word-break:break-all;font-size:14px;line-height:1.6em;\"\u003e\n\n\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eBook Introduction\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\u003cdiv\u003e \u003cb\u003eDigging deep into Rust to reveal its true core.\u003c\/b\u003e\u003cbr\u003e\u003cbr\u003e Rust Clean Code introduces Rust-like clean code and design patterns to help you get the most out of Rust's unique language design. It covers topics like metaprogramming, how to implement libraries yourself, and writing fluent interfaces, all with clear explanations and reusable code examples. \u003cbr\u003eIn this course, you will understand the inner workings of Rust and learn how to write efficient Rust code that is easy to maintain and continuously evolve.\u003cbr\u003e\n\n\u003c\/div\u003e\u003c\/div\u003e\n\u003cdiv\u003e\u003cul\u003e\u003cli\u003e You can preview some of the book's contents.\u003cbr\u003e \u003cspan\u003ePreview\u003c\/span\u003e\n\n\u003c\/li\u003e\u003c\/ul\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eindex\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e Translator's Preface x\u003cbr\u003e Beta Reader Review xi\u003cbr\u003e Beginning xiii\u003cbr\u003e Acknowledgements xiv\u003cbr\u003e About this book xv\u003cbr\u003e About the cover xix\u003cbr\u003e\u003cbr\u003e \u003cb\u003ePART I COMPONENTS\u003c\/b\u003e\u003cbr\u003e\u003cbr\u003e CHAPTER 1 Rustdown Pattern 3\u003cbr\u003e 1.1 Topics covered in this book 5\u003cbr\u003e 1.2 What is a design pattern? 6\u003cbr\u003e 1.3 Why This Book Is Different 9\u003cbr\u003e 1.4 Tools Required 10\u003cbr\u003e 1.5 Summary 11\u003cbr\u003e\u003cbr\u003e CHAPTER 2: The Basic Building Blocks of Rust 13\u003cbr\u003e 2.1 Generic 14\u003cbr\u003e 2.1.1 Turing-complete type system 14\u003cbr\u003e 2.1.2 Why Generics? 15\u003cbr\u003e 2.1.3 Basics of Generics 15\u003cbr\u003e 2.1.4 A Look at Rust's Options 19\u003cbr\u003e 2.1.5 Marker Structure and Phantom Type 19\u003cbr\u003e 2.1.6 Generic Parameter Trait Bounds 23\u003cbr\u003e 2.2 Trait 23\u003cbr\u003e 2.2.1 Why Traits Are Not Object-Oriented Programming 24 \u003cbr\u003e2.2.2 What's in the Trait 25\u003cbr\u003e 2.2.3 Understanding Traits by Examining Object-Oriented Code 26\u003cbr\u003e 2.2.4 Combining Generics and Traits 30\u003cbr\u003e 2.2.5 Automatically Deriving Traits 35\u003cbr\u003e 2.2.6 Trait Object 37\u003cbr\u003e 2.3 Summary 40\u003cbr\u003e\u003cbr\u003e CHAPTER 3 Code Flow 43\u003cbr\u003e 3.1 Pattern Matching Overview 44\u003cbr\u003e 3.1.1 Basics of Pattern Matching 44\u003cbr\u003e 3.1.2 Concise processing with the ? operator 50\u003cbr\u003e 3.2 Functional Rust 53\u003cbr\u003e 3.2.1 Rust Functional Programming Fundamentals 54\u003cbr\u003e 3.2.2 Capturing Closure Variables 56\u003cbr\u003e 3.2.3 Examining Iterators 57\u003cbr\u003e 3.2.4 Obtaining an iterator with iter(), into_iter(), and iter_mut() 62\u003cbr\u003e 3.2.5 Iterator Functions 71\u003cbr\u003e 3.3 Summary 76\u003cbr\u003e\u003cbr\u003e \u003cb\u003ePART II Core Patterns\u003c\/b\u003e\u003cbr\u003e\u003cbr\u003e CHAPTER 4 Basic Patterns 79\u003cbr\u003e 4.1 Acquiring resources is initialized to 80\u003cbr\u003e 4.1.1 RAII in C and C++ 81\u003cbr\u003e 4.1.2 A Tour of Rust's RAII 85\u003cbr\u003e 4.1.3 Summary of Rust's RAII 87\u003cbr\u003e 4.2 Passing arguments by value and by reference 89\u003cbr\u003e 4.2.1 Passing by Value 89\u003cbr\u003e 4.2.2 Passing by Reference 91 \u003cbr\u003e4.2.3 When to do what?: Passing by value and passing by reference 93\u003cbr\u003e 4.3 Constructor 94\u003cbr\u003e 4.4 Object Member Visibility and Accessibility 97\u003cbr\u003e 4.5 Error Handling 99\u003cbr\u003e 4.6 Global Status 102\u003cbr\u003e 4.6.1 lazy-static.rs 105 \/ 4.6.2 once_cell 106\u003cbr\u003e 4.6.3 static_init 107 \/ 4.6.4 std::cell::OnceCell 108\u003cbr\u003e 4.7 Summary 109\u003cbr\u003e\u003cbr\u003e CHAPTER 5 Design Patterns: Beyond the Basics 111\u003cbr\u003e 5.1 Metaprogramming with Macros 112\u003cbr\u003e 5.1.1 Basic Declarative Macros 113\u003cbr\u003e 5.1.2 When should I use macros? 115\u003cbr\u003e 5.1.3 Writing a Mini-DSL Using Macros 121\u003cbr\u003e 5.1.4 Using Macros for DRY 122\u003cbr\u003e 5.2 Optional function arguments 126\u003cbr\u003e 5.2.1 Examining Optional Arguments in Python 126\u003cbr\u003e 5.2.2 Examining Optional Arguments in C++ 127\u003cbr\u003e 5.2.3 Rust has no optional arguments 127\u003cbr\u003e 5.2.4 Mocking Optional Arguments with Traits 128\u003cbr\u003e 5.3 Builder Pattern 131\u003cbr\u003e 5.3.1 Implementing the Builder Pattern 132\u003cbr\u003e 5.3.2 Strengthening Builders with Traits 134\u003cbr\u003e 5.3.3 Developing Builders with Macros 135 \u003cbr\u003e5.4 Fluent Interface Pattern 139\u003cbr\u003e 5.4.1 Fluent Builder 139\u003cbr\u003e 5.4.2 Fluent Builder Test 142\u003cbr\u003e 5.5 Observer Pattern 143\u003cbr\u003e 5.5.1 Why Not Use Callbacks? 143\u003cbr\u003e 5.5.2 Implementing an Observer 144\u003cbr\u003e 5.6 Command Pattern 147\u003cbr\u003e 5.6.1 Defining Command Patterns 148\u003cbr\u003e 5.6.2 Implementing the Command Pattern 149\u003cbr\u003e 5.7 Newtype Pattern 152\u003cbr\u003e 5.8 Summary 155\u003cbr\u003e\u003cbr\u003e CHAPTER 6 Designing Libraries 157\u003cbr\u003e 6.1 Good Library Design 158\u003cbr\u003e 6.2 Do One Thing Right, Do It Well 159\u003cbr\u003e 6.3 Avoiding Excessive Abstraction 160\u003cbr\u003e 6.4 Sticking to Basic Types 160\u003cbr\u003e 6.5 Using Tools 161\u003cbr\u003e 6.6 Good artists copy, great artists steal (from the standard library) 162\u003cbr\u003e 6.7 Document everything and provide examples 162\u003cbr\u003e 6.8 Don't mess with your users' code 163\u003cbr\u003e 6.9 Think about the state 163\u003cbr\u003e 6.10 Considering Aesthetics 164\u003cbr\u003e 6.11 Ease of Use of Rust Libraries 165\u003cbr\u003e 6.11.1 Revisiting Linked Lists 165\u003cbr\u003e 6.11.2 Improving API Design with Rustdoc 167 \u003cbr\u003e6.11.3 Improving Linked Lists with More Testing 174\u003cbr\u003e 6.11.4 Creating a Library That's Easy for Others to Debug 176\u003cbr\u003e 6.12 Summary 179\u003cbr\u003e\u003cbr\u003e \u003cb\u003ePART III ADVANCED PATTERNS\u003c\/b\u003e\u003cbr\u003e\u003cbr\u003e CHAPTER 7: Using Traits, Generics, and Structs for Specialized Tasks 183\u003cbr\u003e 7.1 Constant Generics 184\u003cbr\u003e 7.2 Implementing Traits for External Crate Types 186\u003cbr\u003e 7.2.1 Wrapper Structures 187 \/ 7.2.2 Unwrapping Wrapped Structures Using Deref 187\u003cbr\u003e 7.3 Extended Trait 189\u003cbr\u003e 7.4 Blanket Trait 191\u003cbr\u003e 7.5 Marker Trait 194\u003cbr\u003e 7.6 Structure Tagging 196\u003cbr\u003e 7.7 Reference Objects 199\u003cbr\u003e 7.8 Summary 205\u003cbr\u003e\u003cbr\u003e CHAPTER 8: State Machines, Coroutines, Macros, and Preludes 207\u003cbr\u003e 8.1 Trait State Machine 208\u003cbr\u003e 8.2 Coroutines 212\u003cbr\u003e 8.3 Procedural Macros 218\u003cbr\u003e 8.4 Prelude 222\u003cbr\u003e 8.5 Summary 226\u003cbr\u003e\u003cbr\u003e \u003cb\u003ePART IV Avoiding Problems\u003cbr\u003e CHAPTER 9: IMMUTABILITY 229\u003cbr\u003e 9.1 The Advantages of Immutability 230\u003cbr\u003e 9.2 Why Immutability Isn't a Panacea 232\u003cbr\u003e 9.3 How to Think About Immutable Data 233\u003cbr\u003e 9.4 Understanding Rust's Immutability 234\u003c\/b\u003e \u003cbr\u003e9.5 Examining the Basic Concept of Immutability 236\u003cbr\u003e 9.6 Using Traits to Make (Almost) Everything Immutable 239\u003cbr\u003e 9.7 Using Cow for Immutability 240\u003cbr\u003e 9.8 Crate for Immutable Data Structures 244\u003cbr\u003e 9.8.1 Using im 244 \/ 9.8.2 Using rpds 245\u003cbr\u003e 9.9 Summary 247\u003cbr\u003e\u003cbr\u003e CHAPTER 10: ANTIPATTERNS 249\u003cbr\u003e 10.1 What is an Antipattern? 250\u003cbr\u003e 10.2 Using unsafe 251\u003cbr\u003e 10.2.1 What does unsafe do? 253\u003cbr\u003e 10.2.2 Where can I use unsafe? 254\u003cbr\u003e 10.2.3 When should I use unsafe? 256\u003cbr\u003e 10.2.4 Is unsafe dangerous? 257\u003cbr\u003e 10.3 Using unwrap() 257\u003cbr\u003e 10.4 Not Using Vec 258\u003cbr\u003e 10.5 Too many copies 262\u003cbr\u003e 10.6 Using Deref to Emulate Polymorphism 263\u003cbr\u003e 10.7 Global Data and Singletons 268\u003cbr\u003e 10.8 Too Many Smart Pointers 269\u003cbr\u003e 10.9 The Way Forward 270\u003cbr\u003e 10.10 Summary 271\u003cbr\u003e\u003cbr\u003e APPENDIX A Installing Rust 273\u003cbr\u003e A.1 Installing the Tools Required for This Book 273\u003cbr\u003e A.1.1 Installing Tools for macOS Using Homebrew 273 \u003cbr\u003eA.1.2 Installing Tools for Linux Systems 274\u003cbr\u003e A.1.3 Installing Tools for Windows 274\u003cbr\u003e A.2 Managing rustc and other Rust components with rustup 275\u003cbr\u003e A.2.1 Installing rustc and other components 275\u003cbr\u003e A.2.2 Switching the default toolchain with rustup 275\u003cbr\u003e A.2.3 Updating Rust Components 275\u003cbr\u003e\u003cbr\u003e Search 277\n\n\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eDetailed image\u003c\/b\u003e \u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\u003cdiv\u003e\u003cimg src=\"https:\/\/image.yes24.com\/momo\/TopCate5854\/MidCate003\/585323679.jpg\" border=\"0\" alt=\"Detailed Image 1\"\u003e\u003c\/div\u003e\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003eInto the book\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e Unlike Design Patterns from the GoF, this book is not a list of design patterns, but rather a discussion and exploration of specific patterns, examples, and implementations.\u003cbr\u003e There are two reasons why we don't list patterns:\u003cbr\u003e Patterns are not just templates or boilerplate, and copying and pasting patterns only gets you 10% (or less) of the way to complete code.\u003cbr\u003e This book is for readers who have a desire for knowledge and personal growth.\u003cbr\u003e\u003cbr\u003e --- p.9\u003cbr\u003e \u003cbr\u003eRust's unique language features require more thought when designing APIs and writing high-quality code.\u003cbr\u003e In particular, you need to think more about how to manage memory and object lifetimes, pass values ​​between contexts, avoid race conditions, and ensure that your API is user-friendly.\u003cbr\u003e Rust is also full of new opportunities to create and discover new patterns, and it will undoubtedly continue to evolve even after this book is published.\u003cbr\u003e To get to Mars, we need to build a rocket that can get to Mars, and we also need to solve countless problems that will arise during the seven-month journey.\u003cbr\u003e\u003cbr\u003e --- p.10\u003cbr\u003e\u003cbr\u003e Although we mentioned in the introduction to this chapter that newtypes are a Rust-specific pattern, strictly speaking, there are no restrictions on applying the same concept to other programming languages. \u003cbr\u003eAs far as I know, the term Rust-specific simply means that the pattern originated within the Rust community.\u003cbr\u003e\u003cbr\u003e --- p.152\u003cbr\u003e\u003cbr\u003e When asked how he created the statue of David, Michelangelo replied, “I just carved away everything that didn’t look like David.”\u003cbr\u003e The same goes for library design.\u003cbr\u003e We need to trim away unnecessary abstractions until we are left with the simplest and most elegant solution to the problem we are trying to solve.\u003cbr\u003e\u003cbr\u003e --- p.160\u003cbr\u003e\u003cbr\u003e Ultimately, the definition of an anti-pattern comes down to opinion and preference.\u003cbr\u003e However, in some cases, a practice may be objectively bad, for example, if it is unsafe, inefficient, or difficult to maintain. \u003cbr\u003eThese cases are often the result of a combination of factors, including poor design, the desire to maintain backward compatibility, and ongoing changes to acceptable software design.\u003cbr\u003e\n\u003c\/div\u003e\n\u003cdiv\u003e --- p.250\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cbr\u003e\u003cdiv\u003e\u003ch5\u003e \u003cb\u003ePublisher's Review\u003c\/b\u003e\n\u003c\/h5\u003e\u003c\/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e A deep dive into Rust.\u003cbr\u003e Digging into the practical core of Rust, not its theory.\u003cbr\u003e\u003cbr\u003e To truly unlock the power of Rust, which has a high barrier to entry, it's essential to go beyond simply learning the grammar and understand and utilize the language's unique design patterns and idioms.\u003cbr\u003e\u003cbr\u003e If you've started using Rust in real-world projects, you're entering a whole new dimension of exploration. \u003cbr\u003eHow can we apply standard design patterns in Rust applications? Where and why should we use IntoIterator? Why do Rust developers love the PhantomData type? This book answers these and many other questions.\u003cbr\u003e\u003cbr\u003e Rust Clean Code introduces Rust-like clean code and design patterns to help you get the most out of Rust's unique language design. It covers topics like metaprogramming, how to implement libraries yourself, and writing fluent interfaces, all with clear explanations and reusable code examples.\u003cbr\u003e In this course, you will understand the inner workings of Rust and learn how to write efficient Rust code that is easy to maintain and continuously evolve.\u003cbr\u003e\u003cbr\u003e ■ Creating an API that is enjoyable to use\u003cbr\u003e ■ How to apply classic design patterns such as the builder pattern \u003cbr\u003e■ Functional programming patterns\u003cbr\u003e ■ Rust Antipatterns\u003cbr\u003e\n\u003c\/div\u003e\n\u003cdiv\u003e\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cdiv style=\"width:95%;padding-top:20px;padding-bottom:20px\"\u003e\n\n\u003cdiv style=\"text-align:left;font-size:16px;font-weight:bold;padding-bottom:20px\"\u003e GOODS SPECIFICS \u003c\/div\u003e\n\n\u003cdiv style=\"text-align:left;font-size:14px;line-height:1.6em;\"\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003eDate of issue:\u003c\/strong\u003e September 4, 2025\u003c\/div\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003ePage count, weight, size:\u003c\/strong\u003e 300 pages | 188*245*15mm\u003c\/div\u003e\n\n\u003cdiv style=\"width:100%;margin-bottom:5px;line-height:1.6em;font-size:14px\"\u003e - \u003cstrong\u003eISBN13:\u003c\/strong\u003e 9791194587323 \u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\n\u003c\/div\u003e\n\n\u003ccenter\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003ccenter\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd style=\"height:10px\"\u003e\u003c\/td\u003e\u003c\/tr\u003e\u003c\/table\u003e\u003c\/center\u003e\n\n\u003cspan\u003e\u003c\/span\u003e\n\n\u003c\/center\u003e\n\n\n\u003c\/center\u003e","brand":"LIBRAIRIE COREENNE","offers":[{"title":"Default Title","offer_id":43893162836010,"sku":"128648","price":38.0,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0683\/2750\/5962\/files\/8951d367aafc78b0914003b9e48fa04d.jpg?v=1765390875","url":"https:\/\/librairie.coreenne.fr\/en\/products\/128648","provider":"LIBRAIRIE COREENNE","version":"1.0","type":"link"}