Add table of contents to some modules (#1084)

This commit is contained in:
David Pedersen 2022-06-14 14:10:04 +02:00 committed by GitHub
parent 18e45c4fdd
commit ad67289226
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 0 deletions

View file

@ -1,5 +1,12 @@
Error handling model and utilities Error handling model and utilities
# Table of contents
- [axum's error handling model](#axums-error-handling-model)
- [Routing to fallible services](#routing-to-fallible-services)
- [Applying fallible middleware](#applying-fallible-middleware)
- [Running extractors for error handling](#running-extractors-for-error-handling)
# axum's error handling model # axum's error handling model
axum is based on [`tower::Service`] which bundles errors through its associated axum is based on [`tower::Service`] which bundles errors through its associated

View file

@ -1,5 +1,20 @@
Types and traits for extracting data from requests. Types and traits for extracting data from requests.
# Table of contents
- [Intro](#intro)
- [Common extractors](#common-extractors)
- [Applying multiple extractors](#applying-multiple-extractors)
- [Be careful when extracting `Request`](#be-careful-when-extracting-request)
- [Optional extractors](#optional-extractors)
- [Customizing extractor responses](#customizing-extractor-responses)
- [Accessing inner errors](#accessing-inner-errors)
- [Defining custom extractors](#defining-custom-extractors)
- [Accessing other extractors in `FromRequest` implementations](#accessing-other-extractors-in-fromrequest-implementations)
- [Request body extractors](#request-body-extractors)
# Intro
A handler function is an async function that takes any number of A handler function is an async function that takes any number of
"extractors" as arguments. An extractor is a type that implements "extractors" as arguments. An extractor is a type that implements
[`FromRequest`](crate::extract::FromRequest). [`FromRequest`](crate::extract::FromRequest).

View file

@ -1,3 +1,14 @@
# Table of contents
- [Intro](#intro)
- [Applying middleware](#applying-middleware)
- [Commonly used middleware](#commonly-used-middleware)
- [Writing middleware](#writing-middleware)
- [Routing to services/middleware and backpressure](#routing-to-servicesmiddleware-and-backpressure)
- [Sharing state between handlers and middleware](#sharing-state-between-handlers-and-middleware)
# Intro
axum is unique in that it doesn't have its own bespoke middleware system and axum is unique in that it doesn't have its own bespoke middleware system and
instead integrates with [`tower`]. This means the ecosystem of [`tower`] and instead integrates with [`tower`]. This means the ecosystem of [`tower`] and
[`tower-http`] middleware all work with axum. [`tower-http`] middleware all work with axum.

View file

@ -1,5 +1,10 @@
Types and traits for generating responses. Types and traits for generating responses.
# Table of contents
- [Building responses](#building-responses)
- [Returning different response types](#returning-different-response-types)
# Building responses # Building responses
Anything that implements [`IntoResponse`] can be returned from a handler. axum Anything that implements [`IntoResponse`] can be returned from a handler. axum