Skip to content

Commit

Permalink
Add information about the meaning of Router<S> to Router document…
Browse files Browse the repository at this point in the history
…ation (#3235)
  • Loading branch information
wkordalski authored Feb 27, 2025
1 parent 7724967 commit 2a5189e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions axum/src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>,
Expand Down

0 comments on commit 2a5189e

Please sign in to comment.