mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 00:01:11 +01:00
107 lines
41 KiB
HTML
107 lines
41 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Server builder."><title>ServerBuilder in actix_server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-b778ab399e080a4b.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_server" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (7608018cb 2024-09-29)" data-channel="nightly" data-search-js="search-e056c65ede92db13.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-54bc299d2a5e4e43.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_server/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_server/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_server/index.html">actix_<wbr>server</a><span class="version">2.5.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Server<wbr>Builder</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.backlog" title="backlog">backlog</a></li><li><a href="#method.bind" title="bind">bind</a></li><li><a href="#method.bind_uds" title="bind_uds">bind_uds</a></li><li><a href="#method.disable_signals" title="disable_signals">disable_signals</a></li><li><a href="#method.listen" title="listen">listen</a></li><li><a href="#method.listen_uds" title="listen_uds">listen_uds</a></li><li><a href="#method.max_concurrent_connections" title="max_concurrent_connections">max_concurrent_connections</a></li><li><a href="#method.mptcp" title="mptcp">mptcp</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.run" title="run">run</a></li><li><a href="#method.shutdown_timeout" title="shutdown_timeout">shutdown_timeout</a></li><li><a href="#method.system_exit" title="system_exit">system_exit</a></li><li><a href="#method.worker_max_blocking_threads" title="worker_max_blocking_threads">worker_max_blocking_threads</a></li><li><a href="#method.workers" title="workers">workers</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Default-for-ServerBuilder" title="Default">Default</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-ServerBuilder" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Sync-for-ServerBuilder" title="!Sync">!Sync</a></li><li><a href="#impl-UnwindSafe-for-ServerBuilder" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-ServerBuilder" title="Freeze">Freeze</a></li><li><a href="#impl-Send-for-ServerBuilder" title="Send">Send</a></li><li><a href="#impl-Unpin-for-ServerBuilder" title="Unpin">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Instrument-for-T" title="Instrument">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li><li><a href="#impl-WithSubscriber-for-T" title="WithSubscriber">WithSubscriber</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate actix_<wbr>server</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">actix_server</a></span><h1>Struct <span class="struct">ServerBuilder</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/actix_server/builder.rs.html#33-45">source</a> </span></div><pre class="rust item-decl"><code>pub struct ServerBuilder { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="struct.Server.html" title="struct actix_server::Server">Server</a> builder.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ServerBuilder" class="impl"><a class="src rightside" href="../src/actix_server/builder.rs.html#53-282">source</a><a href="#impl-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#55-71">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h4></section></summary><div class="docblock"><p>Create new Server builder instance</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.workers" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#86-90">source</a><h4 class="code-header">pub fn <a href="#method.workers" class="fn">workers</a>(self, num: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets number of workers to start.</p>
|
||
<p>See <a href="struct.ServerBuilder.html#method.bind" title="method actix_server::ServerBuilder::bind"><code>bind()</code></a> for more details on how worker count affects the number of
|
||
server factory instantiations.</p>
|
||
<p>The default worker count is the determined by <a href="https://doc.rust-lang.org/nightly/std/thread/fn.available_parallelism.html" title="fn std::thread::available_parallelism"><code>std::thread::available_parallelism()</code></a>. See
|
||
its documentation to determine what behavior you should expect when server is run.</p>
|
||
<p><code>num</code> must be greater than 0.</p>
|
||
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
|
||
<p>Panics if <code>num</code> is 0.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.worker_max_blocking_threads" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#105-108">source</a><h4 class="code-header">pub fn <a href="#method.worker_max_blocking_threads" class="fn">worker_max_blocking_threads</a>(self, num: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Set max number of threads for each worker’s blocking task thread pool.</p>
|
||
<p>One thread pool is set up <strong>per worker</strong>; not shared across workers.</p>
|
||
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples:</h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>builder = ServerBuilder::new()
|
||
.workers(<span class="number">4</span>) <span class="comment">// server has 4 worker thread.
|
||
</span>.worker_max_blocking_threads(<span class="number">4</span>); <span class="comment">// every worker has 4 max blocking threads.</span></code></pre></div>
|
||
<p>See [tokio::runtime::Builder::max_blocking_threads] for behavior reference.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.backlog" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#119-122">source</a><h4 class="code-header">pub fn <a href="#method.backlog" class="fn">backlog</a>(self, num: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> Self</h4></section></summary><div class="docblock"><p>Set the maximum number of pending connections.</p>
|
||
<p>This refers to the number of clients that can be waiting to be served. Exceeding this number
|
||
results in the client getting an error when attempting to connect. It should only affect
|
||
servers under significant load.</p>
|
||
<p>Generally set in the 64-2048 range. Default value is 2048.</p>
|
||
<p>This method should be called before <code>bind()</code> method call.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.mptcp" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#137-140">source</a><h4 class="code-header">pub fn <a href="#method.mptcp" class="fn">mptcp</a>(self, mptcp_enabled: <a class="enum" href="enum.MpTcp.html" title="enum actix_server::MpTcp">MpTcp</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets MultiPath TCP (MPTCP) preference on bound sockets.</p>
|
||
<p>Multipath TCP (MPTCP) builds on top of TCP to improve connection redundancy and performance
|
||
by sharing a network data stream across multiple underlying TCP sessions. See <a href="https://www.mptcp.dev">mptcp.dev</a>
|
||
for more info about MPTCP itself.</p>
|
||
<p>MPTCP is available on Linux kernel version 5.6 and higher. In addition, you’ll also need to
|
||
ensure the kernel option is enabled using <code>sysctl net.mptcp.enabled=1</code>.</p>
|
||
<p>This method will have no effect if called after a <code>bind()</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.max_concurrent_connections" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#148-151">source</a><h4 class="code-header">pub fn <a href="#method.max_concurrent_connections" class="fn">max_concurrent_connections</a>(self, num: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets the maximum per-worker number of concurrent connections.</p>
|
||
<p>All socket listeners will stop accepting connections when this limit is reached for
|
||
each worker.</p>
|
||
<p>By default max connections is set to a 25k per worker.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.system_exit" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#162-165">source</a><h4 class="code-header">pub fn <a href="#method.system_exit" class="fn">system_exit</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Sets flag to stop Actix <code>System</code> after server shutdown.</p>
|
||
<p>This has no effect when server is running in a Tokio-only runtime.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.disable_signals" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#168-171">source</a><h4 class="code-header">pub fn <a href="#method.disable_signals" class="fn">disable_signals</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Disables OS signal handling.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.shutdown_timeout" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#179-183">source</a><h4 class="code-header">pub fn <a href="#method.shutdown_timeout" class="fn">shutdown_timeout</a>(self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> Self</h4></section></summary><div class="docblock"><p>Timeout for graceful workers shutdown in seconds.</p>
|
||
<p>After receiving a stop signal, workers have this much time to finish serving requests.
|
||
Workers still alive after the timeout are force dropped.</p>
|
||
<p>By default shutdown timeout sets to 30 seconds.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.bind" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#208-233">source</a><h4 class="code-header">pub fn <a href="#method.bind" class="fn">bind</a><F, U, N>(self, name: N, addrs: U, factory: F) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self><div class="where">where
|
||
F: ServerServiceFactory<TcpStream>,
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/std/net/socket_addr/trait.ToSocketAddrs.html" title="trait std::net::socket_addr::ToSocketAddrs">ToSocketAddrs</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,</div></h4></section></summary><div class="docblock"><p>Adds new service to the server.</p>
|
||
<p>Note that, if a DNS lookup is required, resolving hostnames is a blocking operation.</p>
|
||
<h5 id="worker-count"><a class="doc-anchor" href="#worker-count">§</a>Worker Count</h5>
|
||
<p>The <code>factory</code> will be instantiated multiple times in most scenarios. The number of
|
||
instantiations is number of <a href="struct.ServerBuilder.html#method.workers" title="method actix_server::ServerBuilder::workers"><code>workers</code></a> × number of sockets resolved by
|
||
<code>addrs</code>.</p>
|
||
<p>For example, if you’ve manually set <a href="struct.ServerBuilder.html#method.workers" title="method actix_server::ServerBuilder::workers"><code>workers</code></a> to 2, and use <code>127.0.0.1</code>
|
||
as the bind <code>addrs</code>, then <code>factory</code> will be instantiated twice. However, using <code>localhost</code>
|
||
as the bind <code>addrs</code> can often resolve to both <code>127.0.0.1</code> (IPv4) <em>and</em> <code>::1</code> (IPv6), causing
|
||
the <code>factory</code> to be instantiated 4 times (2 workers × 2 bind addresses).</p>
|
||
<p>Using a bind address of <code>0.0.0.0</code>, which signals to use all interfaces, may also multiple
|
||
the number of instantiations in a similar way.</p>
|
||
<h5 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h5>
|
||
<p>Returns an <code>io::Error</code> if:</p>
|
||
<ul>
|
||
<li><code>addrs</code> cannot be resolved into one or more socket addresses;</li>
|
||
<li>all the resolved socket addresses are already bound.</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.listen" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#241-265">source</a><h4 class="code-header">pub fn <a href="#method.listen" class="fn">listen</a><F, N: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(
|
||
self,
|
||
name: N,
|
||
lst: <a class="struct" href="https://doc.rust-lang.org/nightly/std/net/tcp/struct.TcpListener.html" title="struct std::net::tcp::TcpListener">StdTcpListener</a>,
|
||
factory: F,
|
||
) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self><div class="where">where
|
||
F: ServerServiceFactory<TcpStream>,</div></h4></section></summary><div class="docblock"><p>Adds service to the server using a socket listener already bound.</p>
|
||
<h5 id="worker-count-1"><a class="doc-anchor" href="#worker-count-1">§</a>Worker Count</h5>
|
||
<p>The <code>factory</code> will be instantiated multiple times in most scenarios. The number of
|
||
instantiations is: number of <a href="struct.ServerBuilder.html#method.workers" title="method actix_server::ServerBuilder::workers"><code>workers</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.run" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#268-275">source</a><h4 class="code-header">pub fn <a href="#method.run" class="fn">run</a>(self) -> <a class="struct" href="struct.Server.html" title="struct actix_server::Server">Server</a> <a href="#" class="tooltip" data-notable-ty="Server">ⓘ</a></h4></section></summary><div class="docblock"><p>Starts processing incoming connections and return server controller.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-ServerBuilder-1" class="impl"><a class="src rightside" href="../src/actix_server/builder.rs.html#285-347">source</a><a href="#impl-ServerBuilder-1" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.bind_uds" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#292-309">source</a><h4 class="code-header">pub fn <a href="#method.bind_uds" class="fn">bind_uds</a><F, U, N>(self, name: N, addr: U, factory: F) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self><div class="where">where
|
||
F: ServerServiceFactory<UnixStream>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>,</div></h4></section></summary><div class="docblock"><p>Adds new service to the server using a UDS (unix domain socket) address.</p>
|
||
<h5 id="worker-count-2"><a class="doc-anchor" href="#worker-count-2">§</a>Worker Count</h5>
|
||
<p>The <code>factory</code> will be instantiated multiple times in most scenarios. The number of
|
||
instantiations is: number of <a href="struct.ServerBuilder.html#method.workers" title="method actix_server::ServerBuilder::workers"><code>workers</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.listen_uds" class="method"><a class="src rightside" href="../src/actix_server/builder.rs.html#319-346">source</a><h4 class="code-header">pub fn <a href="#method.listen_uds" class="fn">listen_uds</a><F, N: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(
|
||
self,
|
||
name: N,
|
||
lst: <a class="struct" href="https://doc.rust-lang.org/nightly/std/os/unix/net/listener/struct.UnixListener.html" title="struct std::os::unix::net::listener::UnixListener">UnixListener</a>,
|
||
factory: F,
|
||
) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><Self><div class="where">where
|
||
F: ServerServiceFactory<UnixStream>,</div></h4></section></summary><div class="docblock"><p>Adds new service to the server using a UDS (unix domain socket) listener already bound.</p>
|
||
<p>Useful when running as a systemd service and a socket FD is acquired externally.</p>
|
||
<h5 id="worker-count-3"><a class="doc-anchor" href="#worker-count-3">§</a>Worker Count</h5>
|
||
<p>The <code>factory</code> will be instantiated multiple times in most scenarios. The number of
|
||
instantiations is: number of <a href="struct.ServerBuilder.html#method.workers" title="method actix_server::ServerBuilder::workers"><code>workers</code></a>.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-ServerBuilder" class="impl"><a class="src rightside" href="../src/actix_server/builder.rs.html#47-51">source</a><a href="#impl-Default-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../src/actix_server/builder.rs.html#48-50">source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-ServerBuilder" class="impl"><a href="#impl-Freeze-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section><section id="impl-RefUnwindSafe-for-ServerBuilder" class="impl"><a href="#impl-RefUnwindSafe-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section><section id="impl-Send-for-ServerBuilder" class="impl"><a href="#impl-Send-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section><section id="impl-Sync-for-ServerBuilder" class="impl"><a href="#impl-Sync-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section><section id="impl-Unpin-for-ServerBuilder" class="impl"><a href="#impl-Unpin-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section><section id="impl-UnwindSafe-for-ServerBuilder" class="impl"><a href="#impl-UnwindSafe-for-ServerBuilder" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.ServerBuilder.html" title="struct actix_server::ServerBuilder">ServerBuilder</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#138">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#139">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instrument-for-T" class="impl"><a href="#impl-Instrument-for-T" class="anchor">§</a><h3 class="code-header">impl<T> Instrument for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl"><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a class="fn">instrument</a>(self, span: Span) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the provided [<code>Span</code>], returning an
|
||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a class="fn">in_current_span</a>(self) -> Instrumented<Self></h4></section></summary><div class='docblock'>Instruments this type with the <a href="super::Span::current()">current</a> <a href="crate::Span"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a>Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#809">source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#794">source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-T" class="impl"><a href="#impl-WithSubscriber-for-T" class="anchor">§</a><h3 class="code-header">impl<T> WithSubscriber for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl"><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_subscriber</a><S>(self, subscriber: S) -> WithDispatch<Self><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><Dispatch>,</div></h4></section></summary><div class='docblock'>Attaches the provided <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a class="fn">with_current_subscriber</a>(self) -> WithDispatch<Self></h4></section></summary><div class='docblock'>Attaches the current <a href="crate::dispatcher#setting-the-default-subscriber">default</a> <a href="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
[<code>WithDispatch</code>] wrapper. <a>Read more</a></div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Server":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Server.html\" title=\"struct actix_server::Server\">Server</a></code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Server.html\" title=\"struct actix_server::Server\">Server</a></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"type\" href=\"https://doc.rust-lang.org/nightly/std/io/error/type.Result.html\" title=\"type std::io::error::Result\">Result</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.unit.html\">()</a>>;</div>"}</script></section></div></main></body></html> |