axum-v0.6.0-rc.4
版本发布时间: 2022-11-09 20:51:48
tokio-rs/axum最新发布版本:axum-v0.7.5(2024-03-25 03:19:08)
-
changed: The inner error of a
JsonRejection
is nowserde_path_to_error::Error<serde_json::Error>
. Previously it wasserde_json::Error
(#1371) -
added:
JsonRejection
now displays the path at which a deserialization error occurred too (#1371) -
fixed: Support streaming/chunked requests in
ContentLengthLimit
(#1389) -
fixed: Used
400 Bad Request
forFailedToDeserializeQueryString
rejections, instead of422 Unprocessable Entity
(#1387) -
added: Add
middleware::from_extractor_with_state
andmiddleware::from_extractor_with_state_arc
(#1396) -
added: Add
DefaultBodyLimit::max
for changing the default body limit (#1397) -
added: Add
map_request
,map_request_with_state
, andmap_request_with_state_arc
for transforming the request with an async function (#1408) -
added: Add
map_response
,map_response_with_state
, andmap_response_with_state_arc
for transforming the response with an async function (#1414) -
breaking:
ContentLengthLimit
has been removed.Use DefaultBodyLimit
instead (#1400) -
changed:
Router
no longer implementsService
, call.into_service()
on it to obtain aRouterService
that does (#1368) -
added: Add
Router::inherit_state
, which creates aRouter
with an arbitrary state type without actually supplying the state; such aRouter
can't be turned into a service directly (.into_service()
will panic), but can be nested or merged into aRouter
with the same state type (#1368) -
changed:
Router::nest
now only acceptsRouter
s, the general-purposeService
nesting method has been renamed tonest_service
(#1368) -
added: Support compiling to WASM. See the
simple-router-wasm
example for more details (#1382) -
breaking: New
tokio
default feature needed for WASM support. If you don't need WASM support but havedefault_features = false
for other reasons you likely need to re-enable thetokio
feature (#1382) -
breaking:
handler::{WithState, IntoService}
are merged into one type, namedHandlerService
(#1418) -
changed: The default body limit now applies to the
Multipart
extractor (#1420) -
added: String and binary
From
impls have been added toextract::ws::Message
to be more inline withtungstenite
(#1421) -
added: Add
#[derive(axum::extract::FromRef)]
([#1430]) -
added:
FromRequest
andFromRequestParts
derive macro re-exports from [axum-macros
] behind themacros
feature (#1352) -
breaking:
MatchedPath
can now no longer be extracted in middleware for nested routes (#1462) -
added: Add
extract::RawForm
for accessing raw urlencoded query bytes or request body (#1487) -
breaking: Rename
FormRejection::FailedToDeserializeQueryString
toFormRejection::FailedToDeserializeForm
(#1496)