2.7 KiB
Migration from 0.5 to 0.6
-
ws::Message::Closenow includes optional close reason.ws::CloseCode::Statusandws::CloseCode::Emptyhave been removed. -
HttpServer::threads()renamed toHttpServer::workers(). -
HttpServer::start_ssl()andHttpServer::start_tls()deprecated. UseHttpServer::bind_ssl()andHttpServer::bind_tls()instead. -
HttpRequest::extensions()returns read only reference to the request's ExtensionHttpRequest::extensions_mut()returns mutable reference. -
Instead of
use actix_web::middleware::{ CookieSessionBackend, CookieSessionError, RequestSession, Session, SessionBackend, SessionImpl, SessionStorage};use
actix_web::middleware::sessionuse actix_web::middleware::session{CookieSessionBackend, CookieSessionError, RequestSession, Session, SessionBackend, SessionImpl, SessionStorage}; -
FromRequest::from_request()accepts mutable reference to a request -
FromRequest::Resulthas to implementInto<Reply<Self>> -
Responder::respond_to()is generic overS -
HttpRequest::query()is deprecated. UseQueryextractor.fn index(q: Query<HashMap<String, String>>) -> Result<..> { ... }or
let q = Query::<HashMap<String, String>>::extract(req); -
Websocket operations are implemented as
WsWritertrait. you need to useuse actix_web::ws::WsWriter
Migration from 0.4 to 0.5
-
HttpResponseBuilder::body(),.finish(),.json()methods returnHttpResponseinstead ofResult<HttpResponse> -
actix_web::Method,actix_web::StatusCode,actix_web::Versionmoved toactix_web::httpmodule -
actix_web::headermoved toactix_web::http::header -
NormalizePathmoved toactix_web::httpmodule -
HttpServermoved toactix_web::server, added newactix_web::server::new()function, shortcut foractix_web::server::HttpServer::new() -
DefaultHeadersmiddleware does not use separate builder, all builder methods moved to type itself -
StaticFiles::new()'s show_index parameter removed, useshow_files_listing()method instead. -
CookieSessionBackendBuilderremoved, all methods moved toCookieSessionBackendtype -
actix_web::httpcodesmodule is deprecated,HttpResponse::Ok(),HttpResponse::Found()and otherHttpResponse::XXX()functions should be used instead -
ClientRequestBuilder::body()returnsResult<_, actix_web::Error>instead ofResult<_, http::Error> -
Applicationrenamed to aApp -
actix_web::Reply,actix_web::Resourcemoved toactix_web::dev