Actix web is a small, pragmatic, and extremely fast web framework for Rust.

use actix_web ::{ web , App , Responder , HttpServer }; fn index ( info : web :: Path < ( String , u32 ) > ) -> impl Responder { format ! ( "Hello {}! id:{}" , info . 0 , info . 1 ) } fn main () -> std :: io :: Result < () > { HttpServer :: new ( || App :: new (). service ( web :: resource ( "/{name}/{id}/index.html" ). to ( index )) ) . bind ( "127.0.0.1:8080" ) ? . run () }

Besides the API documentation (which you are currently looking at!), several other resources are available:

To get started navigating the API documentation you may want to consider looking at the following pages:

App: This struct represents an actix-web application and is used to configure routes and other common settings.

HttpServer: This struct represents an HTTP server instance and is used to instantiate and configure servers.

web: This module provide essentials helper functions and types for application registration.

HttpRequest and HttpResponse: These structs represent HTTP requests and responses and expose various methods for inspecting, creating and otherwise utilizing them.

Supported HTTP/1.x and HTTP/2.0 protocols

Streaming and pipelining

Keep-alive and slow requests handling

WebSockets server/client

server/client Transparent content compression/decompression (br, gzip, deflate)

Configurable request routing

Multipart streams

SSL support with OpenSSL or native-tls

Middlewares ( Logger , Session , CORS , CSRF , DefaultHeaders )

, , , , ) Supports Actix actor framework

Supported Rust version: 1.31 or later