Actix
Actix Web is a high-performance HTTP framework on the Actix actor runtime. You register handlers on an App, extract request data, and return types that become responses.
Detailed Explanation
Actix Web predates Axum and remains widely deployed. HttpServer::new(|| App::new().route("/health", web::get().to(health))) starts a server. Handlers take extractors (web::Path, web::Json, web::Data) and return impl Responder. web::Data<T> is the shared state, typically an Arc of a pool or config, registered with app_data.
The name Actix also refers to the actor framework. Actix Web no longer requires you to think in actors for ordinary request/response. You write async functions. Actors still exist for connection-level state and for the original Actix crate. Do not start an actor for a CRUD handler.
Actix Web owns its runtime integration and its own extractor story. Mixing Actix handlers with Axum routers in one process is possible at a reverse-proxy level and painful in-process. Pick one framework per service. Performance of the two is close enough that ecosystem fit matters more than a microbenchmark.
Error handling is Result<T, E> where E: ResponseError. Implement that trait so a domain error becomes a status code and a body. unwrap in a handler is still a panic and a dropped connection.
When you reach for Actix Web: an existing Actix codebase, or a team that already knows it. When you reach for Axum: a new Tokio/Tower-centric service. When you reach for actors: connection state machines, not JSON CRUD.
Actix Web's extractor failures become responses through FromRequest error types. Customising those errors is how you keep a consistent JSON error envelope. If you skip that work, some failures look like Actix's default HTML or text and some look like your ResponseError. Pick one envelope and implement it on both paths.
Code Examples
async fn health() -> &'static str {
"ok"
}
#[tokio::main]
async fn main() {
println!("{}", health().await); // prints: ok
}Common Gotchas
Actix Web handlers are async functions now
You do not need to write actors for a REST handler. Read current docs, not 2018 blog posts.
One framework per process
Running Axum and Actix in one binary means two HTTP stacks. Use a proxy if you must combine.
`ResponseError` is how you get a 404 from `?`
Without it, a `Result` in a handler will not compile or will not map status codes the way you think.