Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blog: announcing axum 0.7.0 #733

Merged
merged 8 commits into from
Nov 27, 2023
15 changes: 11 additions & 4 deletions content/blog/2023-11-23-announcing-axum-0-7-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ The headline feature of `axum` 0.7 is support for `hyper` 1.0. `hyper` is a
foundational library for much of the networking ecosystem in Rust and finally
having a stable API is a big milestone.

[`hyper` 1.0] comes with a big shuffling of the APIs. The previous low level APIs
[`hyper` is guaranteeing] to not make anymore breaking changes for the next
davidpdrsn marked this conversation as resolved.
Show resolved Hide resolved
three years which means the surrounding ecosystem can also become more stable.

`hyper` 1.0 comes with a big shuffling of the APIs. The previous low level APIs
(found in [`hyper::server::conn`]) were stabilized whereas the high
level APIs (such as [`hyper::Server`]) have been removed.

Expand Down Expand Up @@ -139,8 +142,12 @@ middleware you add:
Router::new()
.route(
"/",
// You always extract `Request<Body>` no which middleware
// you add
// You always extract `Request<Body>` no matter
// which middleware you add
//
// This works because `Router` internally converts
// the body into an `axum::body::Body`, which internally
// holds a trait object
get(|body: Request<Body>| async { ... })
)
.layer(tower_http::limit::RequestBodyLimitLayer::new(1024));
Expand Down Expand Up @@ -184,4 +191,4 @@ also welcome to ask questions in [Discord].
[`axum-extra`]: https://crates.io/crates/axum-extra
[`axum-macros`]: https://crates.io/crates/axum-macros
[hyper-serve-example]: https://github.com/tokio-rs/axum/blob/main/examples/serve-with-hyper/src/main.rs
[`hyper` 1.0]: https://seanmonstar.com/blog/hyper-v1/
[`hyper` is guaranteeing]: https://seanmonstar.com/blog/hyper-v1/