With warp, tokio, and reqwest
Bastian Gruber

#Rust
#Web_Development
#APIs
#JSON
#HTTP
#NodeJS
#Java
#PHP
#RESTful_API
Create bulletproof, high-performance web apps and servers with Rust.
In Rust Web Development you will learn:
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
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.
Enabling you to write lightning-fast code with thread-safe concurrency and without a slew of compiler errors or major overhead, Rust continues to be one of the most loved programming languages among developers and companies.
In Rust Web Development, complete an end-to-end Rust application as Rust expert Bastian Gruber gives you an in-depth look at Rust from a fresh new angle. Learning—and falling in love with—Rust has never been easier or more fun.
Give yourself a solid start. In chapter 2, learn Rust basics that will serve as a firm foundation for your Rust education.
Keeping it lean and mean! In chapter 5, onboard ways to streamline your codebase without compromising quality or functionality!
Learn the benefits—and the beauty!—of Rust in chapter 8 as you add a simple HTTP client, step by step, to your codebase on your way to production.
Don’t forget the salt… In chapter 9, learn how to “salt” your password, why you need to, and other essentials for adding authentication and authorization to your Rust web apps.
It’s Go Time! You’ve experienced for yourself the joy of programming in Rust. Now it’s time to show the world what you’ve built. In chapter 10, explore deployment options and ways to get your application production-ready.
One size (or approach) does not fit all… when it comes to testing. Learn to determine the testing approach that fits your application best, and set up different testing environments in chapter 11.
Rust Web Development succeeds where other books on Rust fail: taming Rust’s learning curve—reputed to be steep and bumpy. Author and founder of the Rust and Tell Berlin MeetUp group, Bastian Gruber shares what he’s learned through his own enlightening “Aha!” moments that led him to tackling Rust development from a more practical, less painful angle.
With this hands-on, one-of-a-kind Rust guide, you’ll go from Rust basics to building a complete Rust application—and join the Rust-loving club!
"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
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
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. He has worked for one of the world's largest Digital Currency exchanges, using Rust on its core backend. He has over twelve years experience as a writer, and blogs regularly on Rust for LogRocket, his own blog, and other magazines and news outlets.









