Commit Graph
23 Commits
Author SHA1 Message Date
Theodore BjernhedandTheodore Bjernhed fb64e72de9 Add #[must_use] to types and methods (#3395)
Co-authored-by: Theodore Bjernhed <[email protected]>
2025-07-05 19:07:24 +02:00
Jonas Platte 3525a13459 Revert "Make status a const function in rejection handling" (#3287) 2025-03-27 08:31:19 +01:00
Mohammed Alotaibi e09cc59365 Make status a const function in rejection handling (#3168)
Signed-off-by: Awiteb <[email protected]>
2025-01-11 18:50:32 +00:00
Tobias Bieniek 53370b24e7 axum-core/macros: Change Display impl to match body_text() result (#3118) 2024-12-27 12:20:23 +01:00
Tobias Bieniek 287bd14711 axum-core/macros: Change $body to require literal token (#3117) 2024-12-27 11:39:08 +01:00
Tobias Bieniek fd60c8471d axum-core/macros: Move IntoResponse impls below regular impl blocks (#3116) 2024-12-27 11:27:44 +01:00
Tobias Bieniek 7c934f2a83 axum-core/macros: Avoid double body_text() calls in rejection macros (#3110) 2024-12-27 10:58:45 +01:00
Jonas Platte 391f2deccd core: Fix compile errors from __log_rejection (#2933) 2024-09-25 03:44:35 -04:00
David Mládek 51bb82bb2d axum-core: Correctly use features for tracing macro (#2739) 2024-06-09 23:26:27 +02:00
mikihiro c6fd852844 Update sync_wrapper to 1.0.0 from 0.1.1
... and fix CI.
2024-03-23 19:46:20 +01:00
Mikhail Antoshkin c100650464 Fix items-after-test-module clippy warning on 1.75.0-beta.1 (#2318) 2023-11-16 07:15:16 +00:00
Yuri Astrakhan 786329d85d Use inline format args (#2232) 2023-09-19 06:51:57 +00:00
Sabrina JewsonandDavid Pedersen 3c514ab0b4 Fix .source() of composite rejections (#2030)
Co-authored-by: David Pedersen <[email protected]>
2023-06-22 23:46:39 +02:00
David Pedersen 6b106f4bab Log built-in rejections (#1890) 2023-04-11 16:57:49 +02:00
David Pedersen 352cf9a266 Implement Deref and DerefMut for built-in extractors (#1922) 2023-04-10 07:18:35 +00:00
David Pedersen 7e13d69639 Add status and body_text methods to built-in rejections (#1612)
* Add `status` and `body_text` methods to built-in rejections

This should make it easier to customize a built-in rejection while
preserving either the status or body.

Fixes https://github.com/tokio-rs/axum/issues/1611

* changelog
2022-12-02 19:54:16 +01:00
David Pedersen bf341fd034 Refactor all_the_tuples! macros (#1413) 2022-09-25 15:22:40 +02:00
David Pedersen ef750799fa Automatically handle http_body::LengthLimitError (#1048)
* Automatically handle `http_body::LengthLimitError`

* add tower-http dev dep to axum-core

* just make it a link

* Make `FailedToBufferBody` an enum

* Fix tests now that tower-http handles `Content-Length`

* Bring back explanation for `LengthLimitError`

* remove todo we likely can't fix

* improve wording in docs
2022-06-08 13:47:57 +00:00
David Pedersen 0d05b5e31f Remove deprecated APIs (#800)
* Remove deprecations APIs

* changelog
2022-02-28 23:22:21 +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
David PedersenandJonas Platte b1ef0be1a7 Remove RequestParts::take_extensions (#699)
* Remove `RequestParts::take_extensions`

* fix out of date docs

* Remove RequestAlreadyExtracted and replace it with BodyAlreadyExtracted

* fix docs

* fix test

* Update axum-core/src/extract/mod.rs

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

* Remove macro only used once

Co-authored-by: Jonas Platte <[email protected]>
2022-01-23 18:01:52 +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