axum/axum-core/CHANGELOG.md
Nathaniel McCallum 8084b242d5
Add response::ErrorResponse and response::Result (#921)
* feat: add response::{Error, Result}

This type makes for efficient use of the `?` operator when in a function
with multiple return error types that all implement `IntoResponse`.

Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>

* misc adjustments from PR review

* Rename to `ErrorResponse` and `ResultResponse`

* nitpicky docs changes

* update changelog

* changelog wording

* Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-04-21 16:24:29 +02:00

3.2 KiB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

  • added: Add response::ErrorResponse and response::Result for IntoResponse-based error handling (#921)

0.2.2 (19. April, 2022)

  • added: Add AppendHeaders for appending headers to a response rather than overriding them (#927)

0.2.1 (03. April, 2022)

  • added: Add RequestParts::extract which allows applying an extractor as a method call (#897)

0.2.0 (31. March, 2022)

  • added: Add IntoResponseParts trait which allows defining custom response types for adding headers or extensions to responses (#797)

  • breaking: Using HeaderMap as an extractor will no longer remove the headers and thus they'll still be accessible to other extractors, such as axum::extract::Json. Instead HeaderMap will clone the headers. You should prefer to use TypedHeader to extract only the headers you need (#698)

    This includes these breaking changes:

    • RequestParts::take_headers has been removed.
    • RequestParts::headers returns &HeaderMap.
    • RequestParts::headers_mut returns &mut HeaderMap.
    • HeadersAlreadyExtracted has been removed.
    • The HeadersAlreadyExtracted variant has been removed from these rejections:
      • RequestAlreadyExtracted
      • RequestPartsAlreadyExtracted
    • <HeaderMap as FromRequest<_>>::Rejection has been changed to std::convert::Infallible.
  • breaking: axum::http::Extensions is no longer an extractor (ie it doesn't implement FromRequest). The axum::extract::Extension extractor is not impacted by this and works the same. This change makes it harder to accidentally remove all extensions which would result in confusing errors elsewhere (#699) This includes these breaking changes:

    • RequestParts::take_extensions has been removed.
    • RequestParts::extensions returns &Extensions.
    • RequestParts::extensions_mut returns &mut Extensions.
    • RequestAlreadyExtracted has been removed.
    • <Request as FromRequest>::Rejection is now BodyAlreadyExtracted.
    • <http::request::Parts as FromRequest>::Rejection is now Infallible.
    • ExtensionsAlreadyExtracted has been removed.
  • breaking: RequestParts::body_mut now returns &mut Option<B> so the body can be swapped (#869)

0.1.2 (22. February, 2022)

  • added: Implement IntoResponse for bytes::BytesMut and bytes::Chain<T, U> (#767)

0.1.1 (06. December, 2021)

  • added: axum_core::response::Response now exists as a shorthand for writing Response<BoxBody> (#590)

0.1.0 (02. December, 2021)

  • Initial release.