mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-02 00:00:22 +02:00
Change Router::with_state and impl Service for Router<()> (#1552)
* Implement `Service` for `Router<(), B>` * wip * wip * fix some tests * fix examples * fix doc tests * clean up docs * changelog * fix * also call `with_state` when converting `MethodRouter` into a `MakeService` * suggestions from review
This commit is contained in:
@@ -68,7 +68,7 @@ use std::{convert::Infallible, fmt, marker::PhantomData};
|
||||
/// .route("/set", post(set_secret))
|
||||
/// .route("/get", get(get_secret))
|
||||
/// .with_state(state);
|
||||
/// # let _: axum::routing::RouterService = app;
|
||||
/// # let _: axum::Router = app;
|
||||
/// ```
|
||||
///
|
||||
/// If you have been using `Arc<AppState>` you cannot implement `FromRef<Arc<AppState>> for Key`.
|
||||
|
||||
@@ -86,7 +86,7 @@ use std::{convert::Infallible, fmt, marker::PhantomData};
|
||||
/// .route("/sessions", post(create_session))
|
||||
/// .route("/me", get(me))
|
||||
/// .with_state(state);
|
||||
/// # let _: axum::routing::RouterService = app;
|
||||
/// # let _: axum::Router = app;
|
||||
/// ```
|
||||
/// If you have been using `Arc<AppState>` you cannot implement `FromRef<Arc<AppState>> for Key`.
|
||||
/// You can use a new type instead:
|
||||
|
||||
Reference in New Issue
Block a user