docs: move documentation about order

This commit is contained in:
Nerixyz 2023-07-13 19:20:29 +02:00
parent e8c4b2e673
commit 39360492d9
No known key found for this signature in database
GPG Key ID: 946BA188C5609CCC
1 changed files with 1 additions and 10 deletions

View File

@ -323,16 +323,7 @@ where
/// Middleware can be applied similarly to individual `Scope`s and `Resource`s.
/// See [`Scope::wrap`](crate::Scope::wrap) and [`Resource::wrap`].
///
/// # Middleware Order
/// Notice that the keyword for registering middleware is `wrap`. As you register middleware
/// using `wrap` in the App builder, imagine wrapping layers around an inner App. The first
/// middleware layer exposed to a Request is the outermost layer (i.e., the *last* registered in
/// the builder chain). Consequently, the *first* middleware registered in the builder chain is
/// the *last* to start executing during request processing.
///
/// Ordering is less obvious when wrapped services also have middleware applied. In this case,
/// middlewares are run in reverse order for `App` _and then_ in reverse order for the
/// wrapped service.
/// For more info on middleware take a look at the [`middleware` module][crate::middleware].
///
/// # Examples
/// ```