You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toggle navigation</button><navclass="leftnav collapse show" id=collapsing-docnav><div><h5>Introduction</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/>Welcome</a></li><li><ahref=https://actix.rs/docs/whatis/>What is Actix</a></li></ul></div><h5>Basics</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/getting-started/>Getting Started</a></li><li><ahref=https://actix.rs/docs/application/>Application</a></li><li><ahref=https://actix.rs/docs/server/>Server</a></li><li><ahref=https://actix.rs/docs/handlers/>Handlers</a></li><li><ahref=https://actix.rs/docs/extractors/>Extractors</a></li></ul></div><h5>Advanced</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/errors/>Errors</a></li><li><ahref=https://actix.rs/docs/url-dispatch/>URL Dispatch</a></li><li><ahref=https://actix.rs/docs/request/>Requests</a></li><li><ahref=https://actix.rs/docs/response/>Responses</a></li><li><ahref=https://actix.rs/docs/testing/>Testing</a></li><li><ahref=https://actix.rs/docs/middleware/>Middleware</a></li><li><ahref=https://actix.rs/docs/static-files/>Static Files</a></li></ul></div><h5>Protocols</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/websockets/>Websockets</a></li><li><ahref=https://actix.rs/docs/http2/>HTTP/2</a></li></ul></div><h5>Patterns</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/autoreload/>Auto-Reloading</a></li><liclass=active><ahref=https://actix.rs/docs/databases/>Databases</a></li></ul></div><h5>Diagrams</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/http_server_init/>HTTP Server Initialization</a></li><li><ahref=https://actix.rs/docs/conn_lifecycle/>Connection Lifecycle</a></li></ul></div><h5>API Documentation</h5><div><ulclass=nav><li><ahref=https://docs.rs/actixtarget=view_window>actix <spanclass="fa fa-external-link"></span></a></li><li><ahref=https://docs.rs/actix-web/target=view_window>actix-web <spanclass="fa fa-external-link"></span></a></li></ul></div></div></nav></div><divclass=col-md-9><divclass=actix-content><h1id=async-options>Async Options</h1><p>We have several example projects showing use of async database adapters:</p><ul><li>SQLx: <ahref=https://github.com/actix/examples/tree/master/sqlx_todo>https://github.com/actix/examples/tree/master/sqlx_todo</a></li><li>Postgres: <ahref=https://github.com/actix/examples/tree/master/async_pg>https://github.com/actix/examples/tree/master/async_pg</a></li><li>SQLite: <ahref=https://github.com/actix/examples/tree/master/async_db>https://github.com/actix/examples/tree/master/async_db</a></li></ul><h1id=diesel>Diesel</h1><p>The current version of Diesel (v1) does not support asynchronous operations, so it is important to
4
+
Toggle navigation</button><navclass="leftnav collapse show" id=collapsing-docnav><div><h5>Introduction</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/>Welcome</a></li><li><ahref=https://actix.rs/docs/whatis/>What is Actix</a></li></ul></div><h5>Basics</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/getting-started/>Getting Started</a></li><li><ahref=https://actix.rs/docs/application/>Application</a></li><li><ahref=https://actix.rs/docs/server/>Server</a></li><li><ahref=https://actix.rs/docs/handlers/>Handlers</a></li><li><ahref=https://actix.rs/docs/extractors/>Extractors</a></li></ul></div><h5>Advanced</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/errors/>Errors</a></li><li><ahref=https://actix.rs/docs/url-dispatch/>URL Dispatch</a></li><li><ahref=https://actix.rs/docs/request/>Requests</a></li><li><ahref=https://actix.rs/docs/response/>Responses</a></li><li><ahref=https://actix.rs/docs/testing/>Testing</a></li><li><ahref=https://actix.rs/docs/middleware/>Middleware</a></li><li><ahref=https://actix.rs/docs/static-files/>Static Files</a></li></ul></div><h5>Protocols</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/websockets/>Websockets</a></li><li><ahref=https://actix.rs/docs/http2/>HTTP/2</a></li></ul></div><h5>Patterns</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/autoreload/>Auto-Reloading</a></li><liclass=active><ahref=https://actix.rs/docs/databases/>Databases</a></li></ul></div><h5>Diagrams</h5><div><ulclass=nav><li><ahref=https://actix.rs/docs/http_server_init/>HTTP Server Initialization</a></li><li><ahref=https://actix.rs/docs/conn_lifecycle/>Connection Lifecycle</a></li></ul></div><h5>API Documentation</h5><div><ulclass=nav><li><ahref=https://docs.rs/actixtarget=view_window>actix <spanclass="fa fa-external-link"></span></a></li><li><ahref=https://docs.rs/actix-web/target=view_window>actix-web <spanclass="fa fa-external-link"></span></a></li></ul></div></div></nav></div><divclass=col-md-9><divclass=actix-content><h1id=async-options>Async Options</h1><p>We have several example projects showing use of async database adapters:</p><ul><li>SQLx: <ahref=https://github.com/actix/examples/tree/master/database_interactions/sqlx_todo>https://github.com/actix/examples/tree/master/database_interactions/sqlx_todo</a></li><li>Postgres: <ahref=https://github.com/actix/examples/tree/master/database_interactions/pg>https://github.com/actix/examples/tree/master/database_interactions/pg</a></li><li>SQLite: <ahref=https://github.com/actix/examples/tree/master/database_interactions/basic>https://github.com/actix/examples/tree/master/database_interactions/basic</a></li></ul><h1id=diesel>Diesel</h1><p>The current version of Diesel (v1) does not support asynchronous operations, so it is important to
5
5
use the <ahref=https://docs.rs/actix-web/3/actix_web/web/fn.block.html><code>web::block</code></a> function to offload your database operations to the Actix runtime
6
6
thread-pool.</p><p>You can create action functions that correspond to all the operations your app will perform on the
</span></code></pre></div><p>Upgrades to <em>HTTP/2.0</em> schema described in <ahref=https://http2.github.io/http2-spec/#rfc.section.3.2>rfc section 3.2</a> is not
32
32
supported. Starting <em>HTTP/2</em> with prior knowledge is supported for both clear text
Copy file name to clipboardExpand all lines: docs/index.xml
+1-1
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Currently, only rust-openssl has support.
31
31
alpn negotiation requires enabling the feature. When enabled, HttpServer provides the bind_openssl method.
32
32
[dependencies] actix-web = { version = &#34;3&#34;, features = [&#34;openssl&#34;] } openssl = { version = &#34;0.10&#34;, features = [&#34;v110&#34;] } useactix_web::{web,App,HttpRequest,HttpServer,Responder};useopenssl::ssl::{SslAcceptor,SslFiletype,SslMethod};asyncfn index(_req: HttpRequest)-&gt; implResponder{&#34;Hello.&#34;}#[actix_web::main]asyncfn main()-&gt; std::io::Result&lt;()&gt;{// load ssl keys // to create a self-signed temporary cert for testing: // `openssl req -x509 -newkey rsa:4096 -nodes -keyout key.</description></item><item><title>Auto-Reloading</title><link>https://actix.rs/docs/autoreload/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://actix.rs/docs/autoreload/</guid><description>Auto-Reloading Development Server During development it can be very handy to have cargo automatically recompile the code on changes. This can be accomplished very easily by using cargo-watch.
33
33
cargo watch -x &#39;run --bin app&#39; Historical Note An old version of this page recommended using a combination of systemfd and listenfd, but this has many gotchas and was difficult to integrate properly, especially when part of a broader development workflow. We consider cargo-watch to be sufficient for auto-reloading purposes.</description></item><item><title>Databases</title><link>https://actix.rs/docs/databases/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://actix.rs/docs/databases/</guid><description>Async Options We have several example projects showing use of async database adapters:
34
-
SQLx: https://github.com/actix/examples/tree/master/sqlx_todo Postgres: https://github.com/actix/examples/tree/master/async_pg SQLite: https://github.com/actix/examples/tree/master/async_db Diesel The current version of Diesel (v1) does not support asynchronous operations, so it is important to use the web::block function to offload your database operations to the Actix runtime thread-pool.
34
+
SQLx: https://github.com/actix/examples/tree/master/database_interactions/sqlx_todo Postgres: https://github.com/actix/examples/tree/master/database_interactions/pg SQLite: https://github.com/actix/examples/tree/master/database_interactions/basic Diesel The current version of Diesel (v1) does not support asynchronous operations, so it is important to use the web::block function to offload your database operations to the Actix runtime thread-pool.
35
35
You can create action functions that correspond to all the operations your app will perform on the database.</description></item><item><title>HTTP Server Initialization</title><link>https://actix.rs/docs/http_server_init/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://actix.rs/docs/http_server_init/</guid><description>Architecture overview Below is a diagram of HttpServer initialization, which happens on the following code
36
36
#[actix_web::main]asyncfn main()-&gt; std::io::Result&lt;()&gt;{HttpServer::new(||{App::new().</description></item><item><title>Connection Lifecycle</title><link>https://actix.rs/docs/conn_lifecycle/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://actix.rs/docs/conn_lifecycle/</guid><description>Architecture overview After Server has started listening to all sockets, Accept and Worker are two main loops responsible for processing incoming client connections.
37
37
Once connection accepted Application level protocol processing happens in a protocol specific Dispatcher loop spawned from Worker.
0 commit comments