1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-03-26 00:27:01 +01:00

Document RouterService ()

Not sure what else there is to say :P

Fixes https://github.com/tokio-rs/axum/issues/1401
This commit is contained in:
David Pedersen 2022-10-10 00:23:11 +02:00 committed by GitHub
parent b607ad5823
commit 7420721f4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions
axum/src/routing

View file

@ -481,6 +481,10 @@ where
}
/// Convert this router into a [`RouterService`].
///
/// # Panics
///
/// Panics if the router was constructed with [`Router::inherit_state`].
#[track_caller]
pub fn into_service(self) -> RouterService<B> {
RouterService::new(self)

View file

@ -18,7 +18,7 @@ use crate::{
response::Response,
};
/// TOOD: Docs
/// A [`Router`] converted into a [`Service`].
#[derive(Debug)]
pub struct RouterService<B = Body> {
routes: HashMap<RouteId, Route<B>>,
@ -129,7 +129,6 @@ impl<B> Clone for RouterService<B> {
impl<B> Service<Request<B>> for RouterService<B>
where
B: HttpBody + Send + 'static,
//S: Send + Sync + 'static,
{
type Response = Response;
type Error = Infallible;