Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table of contents to some modules #1084

Merged
merged 1 commit into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions axum/src/docs/error_handling.md
@@ -1,5 +1,12 @@
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 is based on [`tower::Service`] which bundles errors through its associated
Expand Down
15 changes: 15 additions & 0 deletions axum/src/docs/extract.md
@@ -1,5 +1,20 @@
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
"extractors" as arguments. An extractor is a type that implements
[`FromRequest`](crate::extract::FromRequest).
Expand Down
11 changes: 11 additions & 0 deletions axum/src/docs/middleware.md
@@ -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
instead integrates with [`tower`]. This means the ecosystem of [`tower`] and
[`tower-http`] middleware all work with axum.
Expand Down
5 changes: 5 additions & 0 deletions axum/src/docs/response.md
@@ -1,5 +1,10 @@
Types and traits for generating responses.

# Table of contents

- [Building responses](#building-responses)
- [Returning different response types](#returning-different-response-types)

# Building responses

Anything that implements [`IntoResponse`] can be returned from a handler. axum
Expand Down