From 453202b490193fc887b0f2ba71f734371cd88d16 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Fri, 10 Jun 2022 08:46:09 +0200 Subject: [PATCH] Document all cargo features (#1079) --- axum-extra/src/lib.rs | 19 +++++++++++++++++++ axum/src/lib.rs | 2 ++ 2 files changed, 21 insertions(+) diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs index 84d224a5..258ce4f6 100644 --- a/axum-extra/src/lib.rs +++ b/axum-extra/src/lib.rs @@ -1,5 +1,24 @@ //! Extra utilities for [`axum`]. //! +//! # Feature flags +//! +//! axum-extra uses a set of [feature flags] to reduce the amount of compiled and +//! optional dependencies. +//! +//! The following optional features are available: +//! +//! Name | Description | Default? +//! ---|---|--- +//! `async-read-body` | Enables the `AsyncReadBody` body | No +//! `cookie` | Enables the `CookieJar` extractor | No +//! `cookie-private` | Enables the `PrivateCookieJar` extractor | No +//! `cookie-signed` | Enables the `SignedCookieJar` extractor | No +//! `erased-json` | Enables the `ErasedJson` response | No +//! `form` | Enables the `Form` extractor | No +//! `query` | Enables the `Query` extractor | No +//! `spa` | Enables the `Spa` router | No +//! `typed-routing` | Enables the `TypedPath` routing utilities | No +//! //! [`axum`]: https://crates.io/crates/axum #![warn( diff --git a/axum/src/lib.rs b/axum/src/lib.rs index 2978ae23..ac977976 100644 --- a/axum/src/lib.rs +++ b/axum/src/lib.rs @@ -315,6 +315,8 @@ //! `original-uri` | Enables capturing of every request's original URI and the [`OriginalUri`] extractor | Yes //! `tower-log` | Enables `tower`'s `log` feature | Yes //! `ws` | Enables WebSockets support via [`extract::ws`] | No +//! `form` | Enables the `Form` extractor | Yes +//! `query` | Enables the `Query` extractor | Yes //! //! [`TypedHeader`]: crate::extract::TypedHeader //! [`MatchedPath`]: crate::extract::MatchedPath