Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Rust Web Programming
  • Table Of Contents Toc
Rust Web Programming

Rust Web Programming - Third Edition

By : Maxwell Flitton
4 (1)
close
close
Rust Web Programming

Rust Web Programming

4 (1)
By: Maxwell Flitton

Overview of this book

Rust is no longer just for systems programming. This book will show you why this safe and performant language is a crucial up-and-coming option for developing web applications, and get you on your way to building fully functional Rust web apps. You don’t need any experience with Rust to get started, and this new edition also comes with a shallower learning curve. You’ll get hands-on with emerging Rust web frameworks including Actix, Axum, Rocket, and Hyper. You’ll look at injecting Rust into the frontend with WebAssembly and HTTPS configuration with NGINX. Later, you’ll move on to more advanced async topics, exploring TCP and framing, and implementing async systems. As you work through the book, you’ll build a to-do application with authentication using a microservice architecture that compiles into one Rust binary, including the embedding of a frontend JavaScript application in the same binary. The application will have end-to-end atomic testing and a deployment pipeline. By the end of this book, you’ll fully understand the significance of Rust for web development. You’ll also have the confidence to build robust, functional, and scalable Rust web applications from scratch.
Table of Contents (24 chapters)
close
close
22
Other Books You May Enjoy
23
Index

Unit Testing

We have built our to-do application, and it is working. However, we only know it is working because our operations were simple. We know that in the real world, the logic behind our applications will be more complex with more moving parts. This is where unit testing comes in. Unit testing is essential when your application evolves. In this chapter, we will cover the following:

  • The importance of unit testing
  • Writing our first unit test
  • Testing our core
  • Unit testing our networking layer
  • Unit testing our data access layer

By the end of this chapter, you will understand the importance of unit testing. You will also be able to write unit tests and mock IO handles such as calls to a database, to test how our code handles different states. You will also be able to test HTTP requests for a service and build a testing harness that configures a database and runs tests in log files.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Rust Web Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon