Skip to content

Upgrading actix-web 2 to 3

Breaking2.0.0 → 3.3.3Breaking19Platform5Deprecated1New12Changed18Fixed6Other1

BreakingUpgrade verdict

16 breaking changes and 5 platform requirement changes.

  • Renames `IntoHeaderValue::try_into` to `try_into_value` to avoid ambiguity with std `TryInto`.
  • Removes `HttpResponseBuilder::json2()`.
  • `HeaderMap::insert` now returns an iterator of removed values.
  • A method for setting a response header was removed; use the new insert_header method instead.
Top 5 of 22 that need code or config changes
Breaking16
Renames IntoHeaderValue::try_into to try_into_value to avoid ambiguity with std TryInto.
IntoHeaderValue::try_intoIntoHeaderValue::try_into_valueTryInto
Removes HttpResponseBuilder::json2().
HttpResponseBuilder::json2
HeaderMap::insert now returns an iterator of removed values.
HeaderMap::insertHeaderMap::remove
Removes ResponseBuilder::set; use ResponseBuilder::insert_header instead.
ResponseBuilder::setResponseBuilder::insert_headerResponseBuilder::set_header
Removes ResponseBuilder::header; use ResponseBuilder::append_header instead.
ResponseBuilder::headerResponseBuilder::append_header
Removes TestRequest::with_hdr; use TestRequest::default().insert_header() instead.
TestRequest::with_hdrTestRequest::default()insert_header()TestRequest::with_header
Removes the actors optional feature.
actors
Removes the ResponseError impl for actix::MailboxError.
ResponseErroractix::MailboxError
Removes deprecated on_connect methods; use the new on_connect_ext technique instead.
on_connecton_connect_ext
Removes the ResponseError impl for actix::actors::resolver::ResolverError due to deprecation of the resolver actor.
ResponseErroractix::actors::resolver::ResolverError
Removes ConnectError::SslHandshakeError and the HandshakeError re-export; openssl handshake errors now return as ConnectError::SslError.
ConnectError::SslHandshakeErrorHandshakeErrorConnectError::SslError
Removes the failure feature and its support.
failure
client::error::ConnectError Resolver variant now contains a Box<dyn std::error::Error> type.
client::error::ConnectError
Simplifies BlockingError to a unit struct, now only triggered when the blocking thread pool is dead.
BlockingError
HeaderMap::len now returns the number of values instead of the number of keys.
HeaderMap::len
The ws::Message::Text enum variant now contains a bytestring::ByteString.
ws::Message::Textbytestring::ByteString
Platform5
Raises the minimum supported Rust version (MSRV) to 1.88.
Raises the minimum supported Rust version (MSRV) to 1.68 due to a transitive time dependency.
Raises the minimum supported Rust version (MSRV) to 1.59.
Raises the minimum supported Rust version (MSRV) to 1.57 due to the transitive time dependency.
Bumps the minimum supported Rust version to 1.40.
Deprecated1
Soft-deprecates NormalizePath::default(), noting an upcoming behavior change in v4.
NormalizePath::default()