use tower-http patch

This commit is contained in:
David Pedersen
2023-03-24 15:11:30 +01:00
parent c73b6a9969
commit 11a543a409
11 changed files with 25 additions and 46 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ use tower_layer::Layer;
/// ```
/// use axum::{Router, routing::post, body::Body, extract::Request};
/// use tower_http::limit::RequestBodyLimitLayer;
/// use http_body::Limited;
/// use http_body_util::Limited;
///
/// let app = Router::new()
/// .route(
@@ -102,7 +102,7 @@ impl DefaultBodyLimit {
/// extract::DefaultBodyLimit,
/// };
/// use tower_http::limit::RequestBodyLimitLayer;
/// use http_body::Limited;
/// use http_body_util::Limited;
///
/// let app: Router<()> = Router::new()
/// .route("/", get(|body: Bytes| async {}))
@@ -137,7 +137,7 @@ impl DefaultBodyLimit {
/// extract::DefaultBodyLimit,
/// };
/// use tower_http::limit::RequestBodyLimitLayer;
/// use http_body::Limited;
/// use http_body_util::Limited;
///
/// let app: Router<()> = Router::new()
/// .route("/", get(|body: Bytes| async {}))
+5 -14
View File
@@ -58,9 +58,7 @@ use std::{
/// async fn handler() -> Result<(), MyError> {
/// Err(MyError::SomethingWentWrong)
/// }
/// # async {
/// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap();
/// # };
/// # let _: Router = app;
/// ```
///
/// Or if you have a custom body type you'll also need to implement
@@ -76,6 +74,7 @@ use std::{
/// };
/// use http::HeaderMap;
/// use bytes::Bytes;
/// use http_body::Frame;
/// use std::{
/// convert::Infallible,
/// task::{Poll, Context},
@@ -90,18 +89,10 @@ use std::{
/// type Data = Bytes;
/// type Error = Infallible;
///
/// fn poll_data(
/// fn poll_frame(
/// self: Pin<&mut Self>,
/// cx: &mut Context<'_>
/// ) -> Poll<Option<Result<Self::Data, Self::Error>>> {
/// # unimplemented!()
/// // ...
/// }
///
/// fn poll_trailers(
/// self: Pin<&mut Self>,
/// cx: &mut Context<'_>
/// ) -> Poll<Result<Option<HeaderMap>, Self::Error>> {
/// cx: &mut Context<'_>,
/// ) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
/// # unimplemented!()
/// // ...
/// }