actix-web v4.0.0-beta.2 Release Notes
Release Date: 2021-02-10 // about 3 years ago-
โ Added
- ๐ The method
Either<web::Json<T>, web::Form<T>>::into_inner()
which returns the inner type for whichever variant was created. Also works forEither<web::Form<T>, web::Json<T>>
. [#1894] - โ Add
services!
macro for helping register multiple services toApp
. [#1933] - Enable registering a vec of services of the same type to
App
[#1933]
๐ Changed
- ๐ Rework
Responder
trait to be sync and returnsResponse
/HttpResponse
directly. Making it simpler and more performant. [#1891] ServiceRequest::into_parts
andServiceRequest::from_parts
can no longer fail. [#1893]ServiceRequest::from_request
can no longer fail. [#1893]- Our
Either
type now usesLeft
/Right
variants (instead ofA
/B
) [#1894] test::{call_service, read_response, read_response_json, send_request}
take&Service
in argument [#1905]App::wrap_fn
,Resource::wrap_fn
andScope::wrap_fn
provide&Service
in closure argument. [#1905]- ๐
web::block
no longer requires the output is a Result. [#1957]
๐ Fixed
- โ
Multiple calls to
App::data
with the same type now keeps the latest call's data. [#1906]
โ Removed
- ๐ Public field of
web::Path
has been made private. [#1894] - ๐ Public field of
web::Query
has been made private. [#1894] - โ
TestRequest::with_header
; useTestRequest::default().insert_header()
. [#1869] AppService::set_service_data
; for custom HTTP service factories adding application data, use the layered data model by callingServiceRequest::add_data_container
when handling requests instead. [#1906]
๐ [#1891]: https://github.com/actix/actix-web/pull/1891 ๐ [#1893]: https://github.com/actix/actix-web/pull/1893 ๐ [#1894]: https://github.com/actix/actix-web/pull/1894 ๐ [#1869]: https://github.com/actix/actix-web/pull/1869 ๐ [#1905]: https://github.com/actix/actix-web/pull/1905 ๐ [#1906]: https://github.com/actix/actix-web/pull/1906 ๐ [#1933]: https://github.com/actix/actix-web/pull/1933 ๐ [#1957]: https://github.com/actix/actix-web/pull/1957
- ๐ The method