Rust Web Development with Rocket A Practical Guide to Starting Your Journey in Rust Web Development Using the Rocket Framework
This book explores the full range of Rocket framework features for creating impressively quick web applications impressively quickly. By unlocking and helping you harness the power of Rust in a practical, no-nonsense way, Rust Web Development with Rocket will have you up and running with Rocket-base...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing, Limited
2022.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009671506006719 |
Tabla de Contenidos:
- 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.