Add serve function and remove Server re-export (#1868)

This commit is contained in:
David Pedersen
2023-03-23 20:25:36 +01:00
parent 2ae0cdf7cf
commit d153719bef
86 changed files with 641 additions and 564 deletions
+1 -3
View File
@@ -41,9 +41,7 @@ use std::{fmt, ops::Deref};
/// }
///
/// let app = Router::new().route("/list_things", get(list_things));
/// # async {
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// # let _: Router = app;
/// ```
///
/// If the query string cannot be parsed it will reject the request with a `400
+1 -1
View File
@@ -101,7 +101,7 @@ pub mod __private {
pub(crate) mod test_helpers {
#![allow(unused_imports)]
use axum::{body::HttpBody, BoxError, Router};
use axum::{extract::Request, response::Response, serve};
mod test_client {
#![allow(dead_code)]
+2 -6
View File
@@ -46,9 +46,7 @@ use std::ops::{Deref, DerefMut};
/// }
///
/// let app = Router::new().route("/users", post(create_user));
/// # async {
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// # let _: Router = app;
/// ```
///
/// # As response
@@ -86,9 +84,7 @@ use std::ops::{Deref, DerefMut};
/// }
///
/// let app = Router::new().route("/users/:id", get(get_user));
/// # async {
/// # axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// # let _: Router = app;
/// ```
#[derive(Debug, Clone, Copy, Default)]
#[cfg_attr(docsrs, doc(cfg(feature = "protobuf")))]