Commit Graph
42 Commits
Author SHA1 Message Date
Dihan Nahdi b0123f7051 feat: impl IntoResponseParts for Redirect (#3721) 2026-05-02 17:46:22 +02:00
Dihan Nahdi 309d1bd953 feat: add #[diagnostic::on_unimplemented] to IntoResponse and IntoResponseParts (#3723) 2026-04-15 13:06:40 +02:00
576968b406 Fix IntoResponse for tuples overriding error response codes (#3603)
Co-authored-by: David Pedersen <[email protected]>
Co-authored-by: Yann Simon <[email protected]>
2026-01-18 20:20:18 +01:00
Tobias Bieniek 33b353def8 Update docs.rs links to 0.8 (#3120) 2024-12-27 13:15:58 +01:00
Jonas Platte b214e39581 Add more must_use attributes (#2846)
… so people get a warning when they accidentally add a semicolon after the response expression in a handler function.

Also update changelogs of axum-core, axum-extra.
2024-09-11 19:17:25 +00:00
Johann Birnick 68cfdced91 Derive Clone and Copy for AppendHeaders (#2776) 2024-06-09 23:24:30 +02:00
Nick Price 934b1aac06 Grammar: Fix "it's" vs "its" in several places (#2518) 2024-01-15 21:48:11 +01:00
David Pedersen 85573e0573 impl IntoResponseParts for () (#2471) 2023-12-30 17:47:22 +00:00
Justin Sexton f98bc1186a Updated doc link versions to use more explicit 0.7 version. (#2379) 2023-11-29 09:31:17 +00:00
43b14a5f02 Update to latest versions of hyper and http-body (#1882)
Co-authored-by: Michael Scofield <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
2023-11-23 11:03:03 +00:00
David Pedersen cc611b8b24 Implement IntoResponse for (R,) where R: IntoResponse (#2143) 2023-08-03 18:15:06 +00:00
Alexander van Ratingen adb387a370 Implement IntoResponse for boxed slices (#2035) 2023-06-26 11:14:28 +00:00
David Pedersen 173f9f72b0 Remove IntoResponse for http-body types (#1877) 2023-04-21 17:45:31 +02:00
6703f8634c Remove B type param: Follow ups (#1789)
Co-authored-by: Jonas Platte <[email protected]>
Co-authored-by: Michael Scofield <[email protected]>
2023-04-21 17:45:31 +02:00
4e4c29175f Remove B type param (#1751)
Co-authored-by: Jonas Platte <[email protected]>
Co-authored-by: Michael Scofield <[email protected]>
2023-04-21 17:45:31 +02:00
David Pedersen 5606ea3f9e #[must_use] all the things! (#1809) 2023-03-03 14:12:35 +01:00
valkyrie_pilotandDavid Pedersen e4c6d76bca Implement IntoResponse for [u8; N] and &'static [u8; N] (#1690)
Co-authored-by: David Pedersen <[email protected]>
2023-01-13 09:12:51 +00:00
David Pedersen 958d360ac4 Generalize AppendHeaders to accept any impl IntoIterator (#1495)
* Generalize `AppendHeaders` to accept any `impl IntoIterator`

* changelog
2022-10-20 21:05:04 +02:00
David Pedersen bf341fd034 Refactor all_the_tuples! macros (#1413) 2022-09-25 15:22:40 +02:00
Jonas Platte 1812c4dfe8 Remove explicit TryFrom, TryInto imports (#1099) 2022-06-17 18:36:49 +00:00
David Pedersen 19fe93262f Use impl IntoResponse less in docs (#1049) 2022-05-22 13:41:29 +02:00
David Pedersen 8dd6070574 Implement IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse) (#980)
* Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)`

Fixes #979

* changelog

* docs

* changelog ref
2022-04-29 22:08:47 +02:00
Marcus GriepandDavid Pedersen 6e1835074c Implement IntoResponse for Response<()> and response::Parts (#950)
* feat(axum-core): add IntoResponse for `http::response` types

* chore: narrow impl to `Response<()>`

* include extensions

* changelog

Co-authored-by: David Pedersen <[email protected]>
2022-04-29 17:52:21 +02:00
David Pedersen 5bb924b3a2 Implement IntoResponse and IntoResponseParts for http::Extensions (#975)
* Implement `IntoResponse` and `IntoResponseParts` for `http::Extensions`

Requires a new release of `http`.

* remove http patch

* changelog ref
2022-04-29 17:28:24 +02:00
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 <[email protected]>

* 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 <[email protected]>

Co-authored-by: David Pedersen <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
2022-04-21 16:24:29 +02:00
David Pedersen afcefb4a70 Add AppendHeaders (#927)
* Add `AppendHeaders`

* axum changelog
2022-04-17 23:14:04 +02:00
David Pedersen 87a2b0dac1 Implement IntoResponseParts for Option<T> (#838) 2022-03-07 16:37:34 +01:00
David Pedersen ae22154979 Add example for implementing IntoResponseParts (#825) 2022-03-04 10:53:17 +01:00
David Pedersen 1c8f09268b Implement IntoResponseParts for more tuples (#817) 2022-03-03 08:07:00 +01:00
David Pedersen 5f54855b05 Remove IntoResponse and IntoResponseParts impls for Version (#815) 2022-03-02 13:07:16 +00:00
David Pedersen 84c725a1ae Make IntoResponseParts more flexible (#813)
* Make `IntoResponseParts` more flexible

* fix `impl<T> IntoResponseParts for TypedHeader<T>`

* fix
2022-03-02 11:41:14 +00:00
David PedersenandJonas Platte f12ab072c5 Add IntoResponseParts (#797)
* Add `IntoResponseParts`

* docs

* Add test

* don't allow overriding body or response

* macroify impls

* re-order things a bit

* Fix tests

* Also allow overriding version

* Move things into separate modules

* docs

* clean up

* fix trybuild test

* remove churn

* simplify buliding response

* fixup test

* fix docs typo

* Use `HeaderValue::from_static`, might be faster

* Bring back `impl IntoResponse` in example

* Remove blanket impl to improve error message

* don't need to set `content-type`

* Apply suggestions from code review

Co-authored-by: Jonas Platte <[email protected]>

* changelog

Co-authored-by: Jonas Platte <[email protected]>
2022-02-28 23:04:33 +00:00
Olivier PinonandDavid Pedersen d12494cc9c Add IntoResponse impl for BytesMut and Chain (#767)
* Add IntoResponse impl for BytesMut and Chain

Co-authored-by: David Pedersen <[email protected]>

* Add CHANGELOG entry

Co-authored-by: David Pedersen <[email protected]>
2022-02-17 13:30:42 +01:00
David Pedersen 208720be53 Clarity Err usage in IntoResponseHeaders 2022-01-25 09:46:38 +01:00
David Pedersen e7051322d3 Make IntoResponseHeaders members hidden 2022-01-23 20:25:12 +01:00
David Pedersen 2546be04f6 Clean up docs for IntoResponseHeaders 2022-01-23 20:25:12 +01:00
David Pedersen d4849820ce Move Headers into axum 2022-01-23 20:25:12 +01:00
Jonas Platte bf83f34617 Add trait IntoResponseHeaders (#649)
* Introduce IntoResponseHeaders trait

* Implement IntoResponseHeaders for HeaderMap

* Add impl IntoResponse for impl IntoResponseHeaders

… and update IntoResponse impls that use HeaderMap to be generic instead.

* Add impl IntoResponseHeaders for Headers

… and remove IntoResponse impls that use it.

* axum-debug: Fix grammar in docs

* Explain confusing error message in docs
2022-01-23 18:01:52 +01:00
Jonas Platte c8c0bb2ce1 Fix a typo (#605) 2021-12-10 18:34:31 +01:00
David Pedersen 8e1341d1f6 Release axum, axum-core, and axum-debug (#591) 2021-12-06 10:30:09 +01:00
Kai Jewson dfb06e721c Introduce Response type alias as a shorthand for Response<BoxBody> (#590)
* Introduce `Response` type alias as a shorthand

* Don't re-export `Response` at the crate root
2021-12-05 19:16:46 +01:00
David Pedersen 254d8fde17 Move FromRequest and IntoResponse into new axum-core crate (#564)
* Move `IntoResponse` to axum-core

* Move `FromRequest` to axum-core

* some clean up

* Remove hyper dependency from axum-core

* Fix docs reference

* Use default

* Update changelog

* Remove mention of default type
2021-11-30 13:46:13 +00:00