* begin threading the state through
* Pass state to extractors
* make state extractor work
* make sure nesting with different states work
* impl Service for MethodRouter<()>
* Fix some of axum-macro's tests
* Implement more traits for `State`
* Update examples to use `State`
* consistent naming of request body param
* swap type params
* Default the state param to ()
* fix docs references
* Docs and handler state refactoring
* docs clean ups
* more consistent naming
* when does MethodRouter implement Service?
* add missing docs
* use `Router`'s default state type param
* changelog
* don't use default type param for FromRequest and RequestParts
probably safer for library authors so you don't accidentally forget
* fix examples
* minor docs tweaks
* clarify how to convert handlers into services
* group methods in one impl block
* make sure merged `MethodRouter`s can access state
* fix docs link
* test merge with same state type
* Document how to access state from middleware
* Port cookie extractors to use state to extract keys (#1250)
* Updates ECOSYSTEM with a new sample project (#1252)
* Avoid unhelpful compiler suggestion (#1251)
* fix docs typo
* document how library authors should access state
* Add `RequestParts::with_state`
* fix example
* apply suggestions from review
* add relevant changes to axum-extra and axum-core changelogs
* Add `route_service_with_tsr`
* fix trybuild expectations
* make sure `SpaRouter` works with routers that have state
* Change order of type params on FromRequest and RequestParts
* reverse order of `RequestParts::with_state` args to match type params
* Add `FromRef` trait (#1268)
* Add `FromRef` trait
* Remove unnecessary type params
* format
* fix docs link
* format examples
* Avoid unnecessary `MethodRouter`
* apply suggestions from review
Co-authored-by: Dani Pardo <dani.pardo@inmensys.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* 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
* 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>
* 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 <jplatte@users.noreply.github.com>
* changelog
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* Add IntoResponse impl for BytesMut and Chain
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* Add CHANGELOG entry
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* 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
* 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 <jplatte@users.noreply.github.com>
* Remove macro only used once
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* Change `HeaderMap` extractor to clone the headers
* fix docs
* changelog
* inline variable
* also add changelog item to axum
* don't list types from axum in axum-core's changelog
* document that `HeaderMap::from_request` clones the headers
* fix typo
* a few more typos
* 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