Improve tower-http doc links (#1842)

This commit is contained in:
Jonas Platte 2023-03-12 11:15:58 +01:00 committed by GitHub
parent 5793e75aac
commit f65fa22f34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 37 deletions

View file

@ -11,6 +11,9 @@ readme = "README.md"
repository = "https://github.com/tokio-rs/axum"
version = "0.3.3" # remember to also bump the version that axum depends on
[features]
__private_docs = ["dep:tower-http"]
[dependencies]
async-trait = "0.1"
bytes = "1.0"
@ -21,6 +24,9 @@ mime = "0.3.16"
tower-layer = "0.3"
tower-service = "0.3"
# optional dependencies
tower-http = { version = "0.4", optional = true, features = ["limit"] }
[build-dependencies]
rustversion = "1.0.9"

View file

@ -69,7 +69,7 @@ use tower_layer::Layer;
/// [`Json`]: https://docs.rs/axum/0.6.0/axum/struct.Json.html
/// [`Form`]: https://docs.rs/axum/0.6.0/axum/struct.Form.html
/// [`FromRequest`]: crate::extract::FromRequest
/// [`RequestBodyLimit`]: https://docs.rs/tower-http/latest/tower_http/limit/struct.RequestBodyLimit.html
/// [`RequestBodyLimit`]: tower_http::limit::RequestBodyLimit
/// [`RequestExt::with_limited_body`]: crate::RequestExt::with_limited_body
/// [`RequestExt::into_limited_body`]: crate::RequestExt::into_limited_body
#[derive(Debug, Clone)]
@ -113,7 +113,6 @@ impl DefaultBodyLimit {
/// .layer(RequestBodyLimitLayer::new(10 * 1000 * 1000));
/// ```
///
/// [`tower_http::limit`]: https://docs.rs/tower-http/0.3.4/tower_http/limit/index.html
/// [`Bytes`]: bytes::Bytes
/// [`Json`]: https://docs.rs/axum/0.6.0/axum/struct.Json.html
/// [`Form`]: https://docs.rs/axum/0.6.0/axum/struct.Form.html

View file

@ -30,8 +30,6 @@ define_rejection! {
///
/// This can _only_ happen when you're using [`tower_http::limit::RequestBodyLimitLayer`] or
/// otherwise wrapping request bodies in [`http_body::Limited`].
///
/// [`tower_http::limit::RequestBodyLimitLayer`]: https://docs.rs/tower-http/0.3/tower_http/limit/struct.RequestBodyLimitLayer.html
pub struct LengthLimitError(Error);
}

View file

@ -27,38 +27,7 @@ tower-log = ["tower/log"]
ws = ["tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64"]
# Required for intra-doc links to resolve correctly
__private_docs = [
"tower/full",
# all tower-http features except (de)?compression-zstd which doesn't
# build on `--target armv5te-unknown-linux-musleabi`
"tower-http/add-extension",
"tower-http/auth",
"tower-http/catch-panic",
"tower-http/compression-br",
"tower-http/compression-deflate",
"tower-http/compression-gzip",
"tower-http/cors",
"tower-http/decompression-br",
"tower-http/decompression-deflate",
"tower-http/decompression-gzip",
"tower-http/follow-redirect",
"tower-http/fs",
"tower-http/limit",
"tower-http/map-request-body",
"tower-http/map-response-body",
"tower-http/metrics",
"tower-http/normalize-path",
"tower-http/propagate-header",
"tower-http/redirect",
"tower-http/request-id",
"tower-http/sensitive-headers",
"tower-http/set-header",
"tower-http/set-status",
"tower-http/timeout",
"tower-http/trace",
"tower-http/util",
"tower-http/validate-request",
]
__private_docs = ["tower/full", "dep:tower-http"]
[dependencies]
async-trait = "0.1.43"
@ -92,7 +61,41 @@ serde_urlencoded = { version = "0.7", optional = true }
sha1 = { version = "0.10", optional = true }
tokio = { package = "tokio", version = "1.25.0", features = ["time"], optional = true }
tokio-tungstenite = { version = "0.18.0", optional = true }
tower-http = { version = "0.4", features = ["util", "map-response-body"], optional = true }
[dependencies.tower-http]
version = "0.4"
optional = true
features = [
# all tower-http features except (de)?compression-zstd which doesn't
# build on `--target armv5te-unknown-linux-musleabi`
"add-extension",
"auth",
"catch-panic",
"compression-br",
"compression-deflate",
"compression-gzip",
"cors",
"decompression-br",
"decompression-deflate",
"decompression-gzip",
"follow-redirect",
"fs",
"limit",
"map-request-body",
"map-response-body",
"metrics",
"normalize-path",
"propagate-header",
"redirect",
"request-id",
"sensitive-headers",
"set-header",
"set-status",
"timeout",
"trace",
"util",
"validate-request",
]
[build-dependencies]
rustversion = "1.0.9"