mirror of
https://github.com/tokio-rs/axum.git
synced 2025-04-26 13:56:22 +02:00
Add information about the meaning of Router<S>
to Router
documentation (#3235)
This commit is contained in:
parent
7724967867
commit
2a5189ed63
1 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,12 @@ macro_rules! panic_on_err {
|
|||
pub(crate) struct RouteId(u32);
|
||||
|
||||
/// The router type for composing handlers and services.
|
||||
///
|
||||
/// `Router<S>` means a router that is _missing_ a state of type `S` to be able
|
||||
/// to handle requests. Thus, only `Router<()>` (i.e. without missing state) can
|
||||
/// be passed to [`serve`]. See [`Router::with_state`] for more details.
|
||||
///
|
||||
/// [`serve`]: crate::serve()
|
||||
#[must_use]
|
||||
pub struct Router<S = ()> {
|
||||
inner: Arc<RouterInner<S>>,
|
||||
|
|
Loading…
Add table
Reference in a new issue