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. #1893ServiceRequest::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 #1905App::wrap_fn
,Resource::wrap_fn
andScope::wrap_fn
provide&Service
in closure
argument. #1905web::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()
. #1869AppService::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