Commit Graph
23 Commits
Author SHA1 Message Date
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