From 25acc8d131fe63a337ee1ffcccc674373a3de9cb Mon Sep 17 00:00:00 2001 From: Niclas Klugmann Date: Fri, 12 Sep 2025 09:21:19 +0200 Subject: [PATCH] Clarify that `AddExtension` is not the actual `Layer` (#3463) --- axum/src/extension.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/axum/src/extension.rs b/axum/src/extension.rs index da3b7b0d..75c8b456 100644 --- a/axum/src/extension.rs +++ b/axum/src/extension.rs @@ -157,6 +157,9 @@ where /// for more details. /// /// [request extensions]: https://docs.rs/http/latest/http/struct.Extensions.html +/// +/// If you need a layer to add an extension to every request, +/// use the [Layer](tower::Layer) implementation of [Extension]. #[derive(Clone, Copy, Debug)] pub struct AddExtension { pub(crate) inner: S,