What you will learn in Rust Web Development
With warp, tokio, and reqwest
Chapter by chapter
Chapter 1: Why Rust?
This introduction presents Rust’s performance, safety, tooling, and versatility as reasons to use it for web development and other systems.
What you learn in chapter 1 →Chapter 2: Laying the foundation
This introduction frames the chapter’s Rust foundations and their value for building adaptable web services.
What you learn in chapter 2 →Chapter 3: Create your first route handler
The introduction establishes Warp’s web-service stack and the purpose of handling cross-origin requests.
What you learn in chapter 3 →Chapter 4: Implement a RESTful API
This introduction explains RESTful resource access, representation independence, and why the web service must share data safely across threads.
What you learn in chapter 4 →Chapter 5: Clean up your codebase
This introduction motivates cleaning up the growing web-service codebase and describes Rust’s documentation, linting, and formatting support.
What you learn in chapter 5 →Chapter 6: Logging, tracing, and debugging
This introduction explains why a Rust web service needs runtime instrumentation and debugging even when its code compiles.
What you learn in chapter 6 →Chapter 7: Add a database to your application
This introduction previews adding a database to the Rust web service and the choices involved in selecting database tooling.
What you learn in chapter 7 →Chapter 8: Integrate third-party APIs
The section introduces considerations for integrating external HTTP calls, including failure handling, concurrent operations, and HTTP client choices.
What you learn in chapter 8 →Chapter 9: Add authentication and authorization
The introduction outlines the application changes needed for authentication and authorization while distinguishing common changes from implementation choices.
What you learn in chapter 9 →Chapter 10: Deploy your application
The introduction explains why deployment requires externally supplied configuration and previews production build and packaging topics.
What you learn in chapter 10 →Chapter 11: Testing your Rust application
This introduction explains why and where to test a Rust web service, distinguishes unit and integration tests, and introduces Rust’s basic testing tools.
What you learn in chapter 11 →Concepts explained in this book
- loggingLogging is the recording of program events and operational information for later inspection.
- tracingtracing is a Rust diagnostics framework for recording structured events and spans, including their relationships across asynchronous tasks.
- software testingSoftware testing is the process of evaluating software to find defects and verify expected behavior.
- integration testIntegration testing evaluates whether interacting parts of a software system work together as expected.
- environment variableAn environment variable is a named value supplied by a process's environment that programs can read to configure behavior.
- security tokenA security token is data presented as evidence of identity, authorization, or other security-related claims.
- loglog is a Rust logging facade crate that provides macros and types for logging without prescribing a particular logging implementation.
- SQLxSQLx is a Rust library for asynchronous interaction with SQL databases, with compile-time checked queries and support for multiple database engines.
- DisplayDisplay is a Rust formatting trait for representing values in human-readable, user-facing form.
- ownershipRust's ownership system governs how values are owned, borrowed, and dropped to ensure memory safety.
- async syntaxAsync syntax is Rust syntax for marking functions or code blocks as asynchronous computations.
- documentationSoftware documentation is written information describing software, its behavior, or how to use it.
- standard errorStandard error is a process's output stream conventionally used for diagnostics and error messages.
- env_loggerenv_logger is a Rust logging implementation that filters log records according to environment-based configuration.
- log4rslog4rs is a Rust logging implementation that supports configurable appenders and configuration files.
- RUST_LOGRUST_LOG is an environment variable used by Rust logging implementations to control which log records are enabled.
- static methodAn associated function is a function defined for a Rust type that is called through the type rather than a value instance.
- eventA tracing event is a structured record of something that happened during program execution, often within a span.
- spanA span is a structured context representing a period of execution in which events and other spans can occur.
- await syntaxAwait syntax in Rust suspends an asynchronous computation until its future can make progress or complete.
- reqwest::Errorreqwest::Error is Reqwest's error type for failures from HTTP client operations.
- async runtimeAn asynchronous runtime schedules and drives asynchronous tasks, managing their progress and associated execution resources.
- request messageAn HTTP request is a message sent by a client to a server using the Hypertext Transfer Protocol.
- mock serverA mock server is a server that simulates an application's behavior for testing.
- reqwestReqwest is a Rust HTTP client library supporting both synchronous and asynchronous requests.
- database migrationA database migration is a versioned change to a database schema or data that can be applied and reverted.
- middlewareMiddleware is software that processes a request in a pipeline before it reaches its handler.
- cross-compilationCross-compilation is the process of building executable software for a target environment different from the one where the build is performed.
- authorizationAuthorization is the process of determining whether an authenticated user or other entity has permission to access a resource or perform an action.
- structured loggingStructured logging is a technique for recording events as machine-readable fields rather than unstructured text.
- pollFuture::poll is the trait method a runtime calls to advance a future's computation.
- doc commentA Rust doc comment is a comment interpreted as documentation and used to generate documentation for code.
- debuggingDebugging is the process of examining a program’s execution to identify and understand defects or unexpected behavior.
- authenticationAuthentication is the process of verifying the identity of a user or other entity.
- library crateA library crate is a Rust crate that provides functionality through a public interface rather than creating an executable.
- RejectReject is a Warp trait that allows a type to represent a custom request rejection.
- crateA crate is a Rust package unit that can be compiled and distributed as a library or executable.
- LLDBLLDB is a debugger that provides facilities for inspecting and controlling program execution.
- mod keywordThe mod keyword in Rust declares a module and identifies its source location.
- Future::OutputFuture::Output is the associated type specifying the value produced when a future completes.
- cargo clippycargo clippy is a Cargo command that runs Clippy on a Rust package.
- paginationDatabase pagination is the technique of retrieving a selected portion of a database result set rather than the entire set at once.
- RejectionA Warp rejection is a value indicating that a filter could not handle a request or explicitly rejected it.
- borrowingRust’s mechanism for temporarily accessing a value through a reference without transferring its ownership.
- ArcArc is Rust’s atomically reference-counted shared pointer type, which allows multiple owners to access heap-allocated data.
- rwlockA read-write lock is a synchronization primitive that allows multiple readers or exclusive access for a writer to shared data.
- route handlerA route handler is a function or component in the example application that processes a request directed to a particular route.
- hash mapA hash map is a data structure that stores key-value pairs and supports lookup by key.
- .env fileAn .env file is a text file containing environment-variable definitions that applications or tools can load as configuration.
- CargoCargo is Rust’s package manager and build tool.
- rustupRustup is the toolchain installer and version manager for Rust.
- partialeqPartialEq is a Rust trait for types whose values can be compared for equality, without requiring a full equivalence relation.
- assert_eqassert_eq! is a Rust macro that checks whether two expressions are equal and panics if they are not.
- debuggerA debugger is a software tool for controlling program execution and inspecting program state to investigate errors.
- sessionA session is the example application's state object for identity information and other data associated with a client's interaction.
- web application frameworkA web framework is a software framework that provides abstractions and components for building web applications or services.
- mutable referenceA Rust reference that permits mutation of the value it refers to, subject to Rust’s borrowing rules.
- parallel test executionParallel test execution runs multiple software tests concurrently rather than one after another.
- CORSCross-Origin Resource Sharing (CORS) is a browser security mechanism that controls whether web pages may access resources from a different origin.
- recover filterA Warp recover filter handles rejections produced by preceding filters and can turn them into responses.
- warp::testwarp::test is a Warp module providing utilities for testing filters and requests without starting a server.
- breakpointA breakpoint is a specified point in a program's code where execution can be paused for inspection.
- SQLSQL is a standardized language for defining, querying, and manipulating data in relational database systems.
- configuration fileA configuration file contains settings that software reads to determine its behavior.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
