axum-core-v0.5.0

tokio-rs/axumaxum-core-v0.5.0Jan 1, 2025by jplatte

AI Summary

Core library update utilizing Rust 1.75 and return-position `impl Trait`.

Key Highlights

  • Replaced `#[async_trait]` with return-position `impl Trait` in traits.
  • Introduced new `OptionalFromRequest` trait for `Option<T>` extractors.
  • Updated minimum Rust version to 1.75.

Breaking Changes

  • Replaced `#[async_trait]` with return-position `impl Trait` in traits.
  • `Option<T>` as an extractor now requires `OptionalFromRequest` or `OptionalFromRequestParts`.

Full Release Notes

## since rc.1

<details>

- **change:** The `Display` impl of all rejections generated by the `define_rejection!()` will now include the `Display` output of the inner error too. This matches the `body_text()` fn output now. ([#3118])

</details>

## full changelog

- **breaking:** Replace `#[async_trait]` with [return-position `impl Trait` in traits][RPITIT] ([#2308])
- **breaking:**: `Option<T>` as an extractor now requires `T` to implement the new trait `OptionalFromRequest` (if used as the last extractor) or `OptionalFromRequestParts` (other extractors) ([#2475])
- **change:** Update minimum rust version to 1.75 ([#2943])
- **change:** The `Display` impl of all rejections generated by the `define_rejection!()` will now include the `Display` output of the inner error too. This matches the `body_text()` fn output now. ([#3118])

[#3118]: https://github.com/tokio-rs/axum/pull/3118

[#2475]: https://github.com/tokio-rs/axum/pull/2475

[RPITIT]: https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html
[#2308]: https://github.com/tokio-rs/axum/pull/2308
[#2943]: https://github.com/tokio-rs/axum/pull/2943