axum-extra-v0.10.0

tokio-rs/axumaxum-extra-v0.10.0Jan 1, 2025by jplatte

AI Summary

Feature-rich release adding new macros, extractors, and response types.

Key Highlights

  • Added `json!` macro for constructing JSON responses.
  • Added `Scheme` extractor for retrieving the request scheme.
  • Added `typed_connect` method to `RouterExt`.
  • Added `file_stream` response type.
  • Added `InternalServerError` shortcut.

Breaking Changes

  • Removed `OptionalFromRequestParts` impl for `Query`.
  • Deprecated `OptionalPath<T>`.
  • The `multipart` feature is no longer on by default.
  • Updated to prost 0.13.

New Features

  • Added `json!` macro
  • Added `Scheme` extractor
  • Added `typed_connect`
  • Added `file_stream`
  • Added `InternalServerError`

Full Release Notes

## since rc.1

<details>

- **breaking:** Remove `OptionalFromRequestParts` impl for `Query` ([#3088])
- **changed:** Query/Form: Use `serde_path_to_error` to report fields that failed to parse ([#3081])

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

</details>

## full changelog

- **breaking:** Update to prost 0.13. Used for the `Protobuf` extractor ([#2829])
- **changed:** Update minimum rust version to 1.75 ([#2943])
- **changed:** Deprecated `OptionalPath<T>` ([#2475])
- **changed:** Query/Form: Use `serde_path_to_error` to report fields that failed to parse ([#3081])
- **changed:** The `multipart` feature is no longer on by default ([#3058])
- **fixed:** `Host` extractor includes port number when parsing authority ([#2242])
- **added:** Add `RouterExt::typed_connect` ([#2961])
- **added:** Add `json!` for easy construction of JSON responses ([#2962])
- **added:** Add `InternalServerError` response for logging an internal error and returning HTTP 500 in a convenient way. ([#3010])
- **added:** Add `FileStream` for easy construction of file stream responses ([#3047])
- **added:** Add `Scheme` extractor ([#2507])

[#3081]: https://github.com/tokio-rs/axum/pull/3081
[#2242]: https://github.com/tokio-rs/axum/pull/2242
[#2475]: https://github.com/tokio-rs/axum/pull/2475
[#3058]: https://github.com/tokio-rs/axum/pull/3058
[#2961]: https://github.com/tokio-rs/axum/pull/2961
[#2962]: https://github.com/tokio-rs/axum/pull/2962
[#3010]: https://github.com/tokio-rs/axum/pull/3010
[#3047]: https://github.com/tokio-rs/axum/pull/3047
[#2507]: https://github.com/tokio-rs/axum/pull/2507
[#2829]: https://github.com/tokio-rs/axum/pull/2829
[#2943]: https://github.com/tokio-rs/axum/pull/2943