Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
0.2.0 (23. August, 2021)
Overall:
please file an issue! (#184) (#198) (#220)
prelude
. Explicit imports are now required (#195)Routing:
Router
to replace theRoutingDsl
trait (#214)Router::or
for combining routes (#108)together. So
Router::new().route("/", get(...)).route("/", post(...))
nowaccepts both
GET
andPOST
. Previously onlyPOST
would be accepted (#224)get
routes will now also be called forHEAD
requests but will always havethe response body removed (#129)
axum::route(...)
withaxum::Router::new().route(...)
. This meansthere is now only one way to create a new router. Same goes for
axum::routing::nest
. (#215)routing::MethodFilter
viabitflags
(#158)handle_error
fromServiceExt
toservice::OnMethod
(#160)With these changes this app using 0.1:
Becomes this in 0.2:
Extractors:
FromRequest
default to being generic overbody::Body
(#146)std::error::Error
for all rejections (#153)OriginalUri
for extracting original request URI in nested services (#197)FromRequest
forhttp::Extensions
(#169)RequestParts::{new, try_into_request}
public so extractors can be used outside axum (#194)FromRequest
foraxum::body::Body
(#241)extract::UrlParams
andextract::UrlParamsMap
. Useextract::Path
instead (#154)extractor_middleware
now requiresRequestBody: Default
(#167)RequestAlreadyExtracted
to an enum with each possible error variant (#167)extract::BodyStream
is no longer generic over the request body (#234)extract::Body
has been renamed toextract::RawBody
to avoid conflicting withbody::Body
(#233)RequestParts
changes (#153)method
new returns an&http::Method
method_mut
new returns an&mut http::Method
take_method
has been removeduri
new returns an&http::Uri
uri_mut
new returns an&mut http::Uri
take_uri
has been removedResponses:
Headers
for easily customizing headers on a response (#193)Redirect
response (#192)body::StreamBody
for easily responding with a stream of byte chunks (#237)Body
andBodyError
types toIntoResponse
. This isrequired for returning responses with bodies other than
hyper::Body
fromhandlers. See the docs for advice on how to implement
IntoResponse
(#86)tower::util::Either
no longer implementsIntoResponse
(#229)This
IntoResponse
from 0.1:Becomes this in 0.2:
SSE:
response::sse::Sse
. This implements SSE using a response rather than a service (#98)axum::sse
. Its been replaced byaxum::response::sse
(#98)Handler using SSE in 0.1:
Becomes this in 0.2:
WebSockets:
Message
an enum (#116)WebSocket
now usesError
as its error type (#150)Handler using WebSockets in 0.1:
Becomes this in 0.2:
Misc
tower-log
which exposestower
'slog
feature. (#218)body::BoxStdError
withaxum::Error
, which supports downcasting (#150)EmptyRouter
now requires the response body to implementSend + Sync + 'static'
(#108)Router::check_infallible
now returns aCheckInfallible
service. Thisis to improve compile times (#198)
Router::into_make_service
now returnsrouting::IntoMakeService
rather thantower::make::Shared
(#229)tower::BoxError
has been replaced withaxum::BoxError
(#229)future
modules (#133)EmptyRouter
,ExtractorMiddleware
,ExtractorMiddlewareLayer
,and
QueryStringMissing
no longer implementCopy
(#132)service::OnMethod
,handler::OnMethod
, androuting::Nested
have new response future types (#157)