Rust Web Development with Rocket: A practical guide to starting your journey in Rust web development using the Rocket framework
Book information
Description
Explore the world of Rocket-fueled web application development and the power of the Rust programming language Key FeaturesDiscover solutions to the common problems faced while creating web applications with RocketLearn everything about Rust, from structs and crates to generics and debuggingCombine Rust and Rocket to create, test, and deploy a full-featured web appBook Description Looking for a fast, powerful, and intuitive framework to build web applications? This Rust book will help you kickstart your web development journey and take your Rust programming skills to the next level as you uncover the power of Rocket - a fast, flexible, and fun framework powered by Rust. Rust Web Development with Rocket wastes no time in getting you up to speed with what Rust is and how to use it. You'll discover what makes it so productive and reliable, eventually mastering all of the concepts you need to play with the Rocket framework while developing a wide set of web development skills. Throughout this book, you'll be able to walk through a hands-on project, covering everything that goes into making advanced web applications, and get to grips with the ins and outs of Rocket development, including error handling, Rust vectors, and wrappers. You'll also learn how to use synchronous and asynchronous programming to improve application performance and make processing user content easy. By the end of the book, you'll have answers to all your questions about creating a web application using the Rust language and the Rocket web framework. What you will learnMaster the basics of Rust, such as its syntax, packages, and toolsGet to grips with Rocket's tooling and ecosystemExtend your Rocket applications using Rust and third-party librariesCreate a full-fledged web app with Rocket that handles user contentWrite pattern-matching logic and handle Rust object lifetimesUse APIs and async programming to make your apps secure and reliableTest your Rocket application and deploy it to productionContainerize and scale your applications for maximum efficiencyWho this book is for This web development book is for software engineers who want to learn how to use the Rocket framework to build web applications. Although not mandatory, basic knowledge of the Rust programming language will help you understand the topics covered easily. Table of ContentsIntroducing the Rust LanguageBuilding Our First Rocket Web ApplicationRocket Requests and ResponsesBuilding, Igniting, and Launching RocketDesigning a User-Generated ApplicationImplementing User CRUDHandling Errors in Rust and RocketServing Static Assets and TemplatesDisplaying Users' PostUploading and Processing PostsSecuring and Adding an API and JSONTesting Your ApplicationLaunching a Rocket ApplicationBuilding a Full Stack ApplicationImproving the Rocket Application Cover Copyright Contributors Table of Contents Preface Part 1: An Introduction to the Rust Programming Language and the Rocket Web Framework Chapter 1: Introducing the Rust Language Technical requirements An overview of the Rust language Why use the Rust language? Installing the Rust compiler toolchain Installing rustup on the Linux OS or macOS Installing a different toolchain and components Updating the toolchain, rustup, and components Writing Hello World! Writing a more complex program Packages and Cargo Cargo package layout Using third-party crates Tools and getting help Tools Text editor Getting help and documentation Summary Chapter 2: Building Our First Rocket Web Application Technical requirements Introducing Rocket – a web framework written in the Rust language The HTTP request life cycle in Rocket Rocket launch sequence Creating our first Rocket web application An asynchronous application Configuring our Rocket web application Starting the Rocket application in different profiles Configuring the Rocket web application Configuring the Rocket application using Rocket.toml Overriding the configuration with environment variables Getting help Summary Chapter 3: Rocket Requests and Responses Technical requirements Understanding Rocket routes HTTP methods URI Path Query Rank Format Data Implementing route handlers Creating responses Wrapping Responder Built-in implementations Making default error catchers Summary Chapter 4: Building, Igniting, and Launching Rocket Technical requirements Managing state Working with a database Attaching Rocket fairings Rocket phases Fairing callbacks Implementing and attaching fairings Connecting to a database using rocket_db_pools Summary Chapter 5: Designing a User-Generated Application Technical requirements Designing a user-generated web application Planning the user struct Creating user routes Making user-generated contents Finalizing the application Modularizing the Rocket application Summary Part 2: An In-Depth Look at Rocket Web Application Development Chapter 6: Implementing User CRUD Technical requirements Implementing GET user Implementing GET users Implementing POST user Implementing PUT and PATCH user Implementing DELETE user Summary Chapter 7: Handling Errors in Rust and Rocket Technical requirements Using panic! Catching panic! Using shutdown Using Option Returning Result Creating a custom error type Logging errors Summary Chapter 8: Serving Static Assets and Templates Technical requirements Serving static assets Introducing the Tera template Showcasing users Working with forms Securing HTML forms from CSRF Summary Chapter 9: Displaying Users' Post Technical requirements Displaying posts – text, photo, and video Using generic data types and trait bounds Learning about ownership and moving Borrowing and lifetime Implementing borrowing and lifetime Summary Chapter 10: Uploading and Processing Posts Technical requirements Uploading a text post Uploading a photo post Processing files asynchronously Uploading a video post and process using a worker Summary Chapter 11: Securing and Adding an API and JSON Technical requirements Authenticating users Authorizing users Handling JSON Protecting the API with a JWT Summary Part 3: Finishing the Rust Web Application Development Chapter 12: Testing Your Application Technical requirements Testing the Rust program Testing the Rocket application Debugging the Rust application Summary Chapter 13: Launching a Rocket Application Technical requirements Optimizing production binaries Setting up the Apache HTTP Server with a Rocket application Generating Docker images for a Rocket application Summary Chapter 14: Building a Full Stack Application Technical requirements Introducing WebAssembly Setting up a Cargo workspace Setting a WebAssembly build target Writing a WebAssembly application using Yew Serving a WebAssembly application using Rocket Summary Chapter 15: Improving the Rocket Application Technical requirements Extending the Rocket application Adding logging Expanding logging to tracing Setting monitoring Setting up a mailing and alerting system Scaling the Rocket application Exploring alternative Rust web frameworks Actix Web Tide Warp Summary Index Other Books You May Enjoy
Similar books
Rust Web Development with Rocket: A practical guide to starting your journey in Rust web development using the Rocket framework
2022 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF