mirror of
https://github.com/tokio-rs/axum.git
synced 2025-01-01 08:56:15 +01:00
Extend from_fn_with_state doctest (#1393)
This commit is contained in:
parent
4ade706ab0
commit
7105805ba2
1 changed files with 5 additions and 2 deletions
|
@ -117,11 +117,14 @@ pub fn from_fn<F, T>(f: F) -> FromFnLayer<F, (), T> {
|
|||
///
|
||||
/// async fn my_middleware<B>(
|
||||
/// State(state): State<AppState>,
|
||||
/// // you can add more extractors here...
|
||||
/// req: Request<B>,
|
||||
/// next: Next<B>,
|
||||
/// ) -> Response {
|
||||
/// // ...
|
||||
/// # ().into_response()
|
||||
/// // do something with `req`...
|
||||
/// let res = next.run(req).await;
|
||||
/// // do something with `res`...
|
||||
/// res
|
||||
/// }
|
||||
///
|
||||
/// let state = AppState { /* ... */ };
|
||||
|
|
Loading…
Reference in a new issue