وسواس خانگی ۲
Household Obsession 2
معرفی کتاب «وسواس خانگی ۲» (با عنوان لاتین Household Obsession 2) نوشتهٔ Anya Merchant، منتشرشده توسط نشر 2024 در سال 2024. این کتاب در فرمت epub، زبان انگلیسی ارائه شده است. «وسواس خانگی ۲» در دستهٔ رمان خارجی قرار دارد.
Create bulletproof, high-performance web apps and servers with Rust. In Rust Web Development you will learn: Handling the borrow checker in an asynchronous environment Learning the ingredients of an asynchronous Rust stack Creating web APIs and using JSON in Rust Graceful error handling Testing, tracing, logging, and debugging Deploying Rust applications Efficient database access Rust Web Development is a pragmatic, hands-on guide to creating server-based web applications with Rust. If you've designed web servers using Java, NodeJS, or PHP, you'll instantly fall in love with the performance and development experience Rust delivers. Hit the ground running! Author Bastian Gruber's sage advice makes it easy to start tackling complex problems with Rust. You'll learn how to work efficiently using pure Rust, along with important Rust libraries such as tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. About the Technology If you're sick of cookie-cutter web development tools that are slow, resource hungry, and unstable, Rust is the solution. Rust services deliver rock-solid safety guarantees, an amazing developer experience, and even a compiler that automatically prevents common mistakes! About the Book Rust Web Development, teaches you to build server-side web apps using Rust, along with important Rust libraries like tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. The book is packed full of examples, code samples, and pro tips for setting up your projects and organizing your code. As you go, you'll build a complete Q&A web service and iterate on your code chapter-by-chapter, just like a real development project. What's Inside Handle the borrow checker in an asynchronous environment Build web APIs and handle JSON Compose a tech stack for asynchronous Rust development Handle errors gracefully Test, trace, log, and debug Deploy Rust applications to multiple environments About the Reader This book is for web developers familiar with Java, Node, or Go, and the absolute basics of Rust. About the Author Bastian Gruber is a Protocol Engineer at Centrifuge. He was part of the official Rust Async Working Group, and founded the Rust and Tell Berlin MeetUp group. Quotes I always assumed Rust was strictly for areas where I'd use C/C++. This book changed my mind! By the end, I was coding as quickly as I could in JS/Node, but with all the protection of a compiled and type-safe language. I'm a convert! - JD McCormack, Meta Walk with a master as he guides you down the path of creating fast, rock-solid, modern web applications. I would not have thought Rust was well-suited for this. Now I'm looking forward to it. - Christoph Baker, Accenture Industry X A gem for those picking up Rust and struggling. It fills in the blanks where many tutorials fall short. In the end, you'll have a working restful API that you can extend to do your bidding and a solid understanding of how it works. - Walt Stoneburner, Bogart Associates of Northern Virginia Rust Web Development 1 brief contents 9 contents 10 preface 15 acknowledgments 17 about this book 19 Who should read this book 19 How this book is organized: A road map 19 About the code 21 liveBook discussion forum 21 about the author 22 about the cover illustration 23 Part 1—Introduction to Rust 25 1 Why Rust? 27 1.1 Batteries included: Rust’s tooling 28 1.2 The Rust compiler 33 1.3 Rust for web services 35 1.4 Maintainability of Rust applications 40 Summary 41 2 Laying the foundation 42 2.1 Following the Rust playbook 43 2.1.1 Modeling your resources with structs 45 2.1.2 Understanding options 47 2.1.3 Using documentation to solve errors 48 2.1.4 Handling strings in Rust 53 2.1.5 Taking an excursion into moving, borrowing, and ownership 55 2.1.6 Using and implementing traits 58 2.1.7 Handling results 66 2.2 Creating our web server 67 2.2.1 Handling multiple requests at once 68 2.2.2 Rust’s asynchronous environment 69 2.2.3 Rust’s handling of async/await 70 2.2.4 Using Rust’s Future type 72 2.2.5 Choosing a runtime 72 2.2.6 Choosing a web framework 74 Summary 77 Part 2—Getting started 79 3 Create your first route handler 81 3.1 Getting to know our web framework: Warp 82 3.1.1 What is included in Warp 83 3.1.2 Warp’s filter system 83 3.2 GET your first JSON response 84 3.2.1 Align with your framework’s way of thinking 85 3.2.2 Handle the success route 86 3.2.3 Get help from Serde 88 3.2.4 Handle errors gracefully 89 3.3 Handling CORS headers 94 3.3.1 Returning CORS headers on the application level 96 3.3.2 Testing CORS responses 97 Summary 100 4 Implement a RESTful API 101 4.1 GET questions from in-memory 103 4.1.1 Setting up a mock database 103 4.1.2 Preparing a set of test data 107 4.1.3 Reading from the fake database 109 4.1.4 Parsing query parameters 113 4.1.5 Returning custom errors 117 4.2 POST, PUT, and DELETE questions 121 4.2.1 Updating our data in a thread-safe way 122 4.2.2 Adding a question 126 4.2.3 Updating a question 128 4.2.4 Handling malformed requests 130 4.2.5 Removing questions from the storage 132 4.3 POST answers via url-form-encoded 134 4.3.1 Difference between url-form-encoded and JSON 134 4.3.2 Adding answers via url-form-encoded 135 Summary 137 5 Clean up your codebase 139 5.1 Modularizing your code 140 5.1.1 Using Rust’s built-in mod system 140 5.1.2 Practical folder structure for different use cases 146 5.1.3 Creating libraries and sub-crates 151 5.2 Documenting your code 155 5.2.1 Using doc comments and private comments 155 5.2.2 Adding code in your comments 157 5.3 Linting and formatting your codebase 160 5.3.1 Installing and using Clippy 160 5.3.2 Formatting your code with Rustfmt 163 Summary 163 6 Logging, tracing, and debugging 165 6.1 Logging in your Rust application 166 6.1.1 Implementing logging in your web service 169 6.1.2 Logging incoming HTTP requests 175 6.1.3 Creating structured logs 179 6.2 Tracing in asynchronous applications 186 6.2.1 Introducing the Tracing crate 187 6.2.2 Integrating tracing in our application 188 6.3 Debugging Rust applications 192 6.3.1 Using GDB on the command line 194 6.3.2 Debugging our web service with LLDB 195 6.3.3 Using Visual Studio Code and LLDB 197 Summary 200 7 Add a database to your application 201 7.1 Setting up our example database 202 7.2 Creating our first tables 203 7.3 Working with a database crate 205 7.3.1 Adding SQLx into our project 208 7.3.2 Connecting Store to our database 209 7.4 Reimplementing our route handlers 213 7.4.1 Adding the database to get_questions 214 7.4.2 Reimplementing the add_question route handler 221 7.4.3 Adjusting the update and delete questions handler 224 7.4.4 Updating the add_answer route 226 7.5 Error handling and tracing database interactions 228 7.6 Integrating SQL migrations 234 7.7 Case study: Switching database management systems 238 Summary 240 8 Integrate third-party APIs 242 8.1 Preparing the codebase 245 8.1.1 Picking an API 245 8.1.2 Getting to know our HTTP crate 247 8.1.3 Adding an example HTTP call with Reqwest 249 8.1.4 Handling errors for external API requests 251 8.2 Deserializing JSON responses to structs 258 8.2.1 Gathering API response information 259 8.2.2 Creating types for our API responses 260 8.3 Sending questions and answers to the API 265 8.3.1 Refactoring the add_question route handler 265 8.3.2 Making profanity checks for updating questions 268 8.3.3 Updating the add_answer route handler 269 8.4 Handling timeouts and multiple requests at once 270 8.4.1 Implementing a retry for external HTTP calls 271 8.4.2 Executing futures concurrently or in parallel 275 Summary 277 Part 3—Bring it into production 279 9 Add authentication and authorization 281 9.1 Adding authentication to our web service 282 9.1.1 Creating the user concept 284 9.1.2 Migrating the database 286 9.1.3 Adding the registration endpoint 288 9.1.4 Hashing the password 291 9.1.5 Handling duplicate account errors 293 9.1.6 Stateful vs. stateless authentication 299 9.1.7 Adding the login endpoint 300 9.1.8 Adding an expiry date to tokens 304 9.2 Adding authorization middleware 306 9.2.1 Migrating the database tables 307 9.2.2 Creating token validation middleware 307 9.2.3 Extending existing routes to handle account IDs 312 9.3 What we didn’t cover 317 Summary 318 10 Deploy your application 319 10.1 Setting up your application through environment variables 320 10.1.1 Set up config files 321 10.1.2 Accept command-line inputs for your application 324 10.1.3 Read and parse environment variables into your web service 326 10.2 Compiling your web service for different environments 332 10.2.1 Development vs. release flag when building your binary 332 10.2.2 Cross-compile your binary for different environments 333 10.3 Using build.rs in your build process 335 10.4 Creating the right Docker image for your web service 338 10.4.1 Create a statically linked Docker image 339 10.4.2 Set up a local Docker environment with docker-compose 340 10.4.3 Extract the configuration of the web server into a new module 343 Summary 347 11 Testing your Rust application 349 11.1 Unit testing our business logic 351 11.1.1 Testing the pagination logic and dealing with custom errors 351 11.1.2 Testing the Config module with environment variables 355 11.1.3 Testing the profanity module with a newly created mock server 359 11.2 Testing our Warp filters 367 11.3 Creating an integration testing setup 371 11.3.1 Splitting up the codebase into a lib.rs and a binary 373 11.3.2 Creating the integration-test crate and the oneshot server implementation 376 11.3.3 Adding the registration test 379 11.3.4 Unwinding in case of an error 383 11.3.5 Testing the login and posting questions 384 Summary 386 Appendix—Thinking about security 388 A.1 Verify your dependencies for security issues 388 A.2 Verify your own code 391 A.3 Closing words 391 index 393 Symbols 393 Numerics 393 A 393 B 393 C 394 D 394 E 395 F 395 G 395 H 396 I 396 J 396 K 396 L 396 M 396 N 397 O 397 P 397 Q 397 R 397 S 398 T 399 U 399 V 400 W 400 Create bulletproof, high-performance web apps and servers with Rust. In Rust Web Development you will Handling the borrow checker in an asynchronous environment Learning the ingredients of an asynchronous Rust stack Creating web APIs and using JSON in Rust Graceful error handling Testing, tracing, logging, and debugging Deploying Rust applications Efficient database access Rust Web Development is a pragmatic, hands-on guide to creating server-based web applications with Rust. If youve designed web servers using Java, NodeJS, or PHP, youll instantly fall in love with the performance and development experience Rust delivers. Hit the ground running! Author Bastian Grubers sage advice makes it easy to start tackling complex problems with Rust. Youll learn how to work efficiently using pure Rust, along with important Rust libraries such as tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology If youre sick of cookie-cutter web development tools that are slow, resource hungry, and unstable, Rust is the solution. Rust services deliver rock-solid safety guarantees, an amazing developer experience, and even a compiler that automatically prevents common mistakes! About the book Rust Web Development , teaches you to build server-side web apps using Rust, along with important Rust libraries like tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. The book is packed full of examples, code samples, and pro tips for setting up your projects and organizing your code. As you go, youll build a complete Q&A web service and iterate on your code chapter-by-chapter, just like a real development project. What's inside Handle the borrow checker in an asynchronous environment Build web APIs and handle JSON Compose a tech stack for asynchronous Rust development Handle errors gracefully Test, trace, log, and debug Deploy Rust applications to multiple environments About the reader This book is for web developers familiar with Java, Node, or Go, and the absolute basics of Rust. About the author Bastian Gruber was part of the official Rust Async Working Group, and founded the Rust and Tell Berlin MeetUp group. Table of Contents PART 1 INTRODUCTION TO RUST 1 Why Rust? 2 Laying the foundation PART 2 GETTING STARTED 3 Create your first route handler 4 Implement a RESTful API 5 Clean up your codebase 6 Logging, tracing, and debugging 7 Add a database to your application 8 Integrate third-party APIs PART 3 BRING IT INTO PRODUCTION 9 Add authentication and authorization 10 Deploy your application 11 Testing your Rust application Create bulletproof, high-performance web apps and servers with Rust.In Rust Web Development you will learn: Handling the borrow checker in an asynchronous environment Learning the ingredients of an asynchronous Rust stack Creating web APIs and using JSON in Rust Graceful error handling Testing, tracing, logging, and debugging Deploying Rust applications Efficient database access Rust Web Development is a pragmatic, hands-on guide to creating server-based web applications with Rust. If you've designed web servers using Java, NodeJS, or PHP, you'll instantly fall in love with the performance and development experience Rust delivers. Hit the ground running! Author Bastian Gruber's sage advice makes it easy to start tackling complex problems with Rust. You'll learn how to work efficiently using pure Rust, along with important Rust libraries such as tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. About the technology If you're sick of cookie-cutter web development tools that are slow, resource hungry, and unstable, Rust is the solution. Rust services deliver rock-solid safety guarantees, an amazing developer experience, and even a compiler that automatically prevents common mistakes! About the book Rust Web Development, teaches you to build server-side web apps using Rust, along with important Rust libraries like tokio for async runtimes, warp for web servers and APIs, and reqwest to run external HTTP requests. The book is packed full of examples, code samples, and pro tips for setting up your projects and organizing your code. As you go, you'll build a complete Q&A web service and iterate on your code chapter-by-chapter, just like a real development project. What's inside Handle the borrow checker in an asynchronous environment Build web APIs and handle JSON Compose a tech stack for asynchronous Rust development Handle errors gracefully Test, trace, log, and debug Deploy Rust applications to multiple environments About the reader This book is for web developers familiar with Java, Node, or Go, and the absolute basics of Rust. About the author Bastian Gruber was part of the official Rust Async Working Group, and founded the Rust and Tell Berlin MeetUp group. Table of Contents PART 1 INTRODUCTION TO RUST 1 Why Rust? 2 Laying the foundation PART 2 GETTING STARTED 3 Create your first route handler 4 Implement a RESTful API 5 Clean up your codebase 6 Logging, tracing, and debugging 7 Add a database to your application 8 Integrate third-party APIs PART 3 BRING IT INTO PRODUCTION 9 Add authentication and authorization 10 Deploy your application 11 Testing your Rust application
دانلود کتاب وسواس خانگی ۲