mirror of
https://github.com/tokio-rs/axum.git
synced 2025-09-28 05:20:46 +00:00
Extend from_fn_with_state doctest (#1393)
This commit is contained in:
parent
4ade706ab0
commit
7105805ba2
@ -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…
x
Reference in New Issue
Block a user