mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-25 12:44:07 +01:00
171 lines
63 KiB
HTML
171 lines
63 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="A builder for a `Server`."><title>Builder in hyper::server - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="hyper" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></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">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../hyper/index.html">hyper</a><span class="version">0.14.27</span></h2></div><h2 class="location"><a href="#">Builder</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.executor">executor</a></li><li><a href="#method.http1_half_close">http1_half_close</a></li><li><a href="#method.http1_header_read_timeout">http1_header_read_timeout</a></li><li><a href="#method.http1_keepalive">http1_keepalive</a></li><li><a href="#method.http1_max_buf_size">http1_max_buf_size</a></li><li><a href="#method.http1_only">http1_only</a></li><li><a href="#method.http1_preserve_header_case">http1_preserve_header_case</a></li><li><a href="#method.http1_title_case_headers">http1_title_case_headers</a></li><li><a href="#method.http1_writev">http1_writev</a></li><li><a href="#method.http2_adaptive_window">http2_adaptive_window</a></li><li><a href="#method.http2_enable_connect_protocol">http2_enable_connect_protocol</a></li><li><a href="#method.http2_initial_connection_window_size">http2_initial_connection_window_size</a></li><li><a href="#method.http2_initial_stream_window_size">http2_initial_stream_window_size</a></li><li><a href="#method.http2_keep_alive_interval">http2_keep_alive_interval</a></li><li><a href="#method.http2_keep_alive_timeout">http2_keep_alive_timeout</a></li><li><a href="#method.http2_max_concurrent_streams">http2_max_concurrent_streams</a></li><li><a href="#method.http2_max_frame_size">http2_max_frame_size</a></li><li><a href="#method.http2_max_header_list_size">http2_max_header_list_size</a></li><li><a href="#method.http2_max_pending_accept_reset_streams">http2_max_pending_accept_reset_streams</a></li><li><a href="#method.http2_max_send_buf_size">http2_max_send_buf_size</a></li><li><a href="#method.http2_only">http2_only</a></li><li><a href="#method.new">new</a></li><li><a href="#method.serve">serve</a></li><li><a href="#method.tcp_keepalive">tcp_keepalive</a></li><li><a href="#method.tcp_keepalive_interval">tcp_keepalive_interval</a></li><li><a href="#method.tcp_keepalive_retries">tcp_keepalive_retries</a></li><li><a href="#method.tcp_nodelay">tcp_nodelay</a></li><li><a href="#method.tcp_sleep_on_accept_errors">tcp_sleep_on_accept_errors</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Builder%3CI,+E%3E">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-Builder%3CI,+E%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Builder%3CI,+E%3E">Send</a></li><li><a href="#impl-Sync-for-Builder%3CI,+E%3E">Sync</a></li><li><a href="#impl-Unpin-for-Builder%3CI,+E%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Builder%3CI,+E%3E">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Instrument-for-T">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li><li><a href="#impl-WithSubscriber-for-T">WithSubscriber</a></li></ul></section><h2><a href="index.html">In hyper::server</a></h2></div></nav><div class="sidebar-resizer"></div>
|
||
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../hyper/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="../index.html">hyper</a>::<wbr><a href="index.html">server</a>::<wbr><a class="struct" href="#">Builder</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/hyper/server/server.rs.html#47-50">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub struct Builder<I, E = Exec> { <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 builder for a <a href="struct.Server.html" title="struct hyper::server::Server"><code>Server</code></a>.</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-Builder%3CI,+E%3E" class="impl"><a class="src rightside" href="../../src/hyper/server/server.rs.html#240-578">source</a><a href="#impl-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E></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/hyper/server/server.rs.html#244-246">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(incoming: I, protocol: <a class="struct" href="conn/struct.Http.html" title="struct hyper::server::conn::Http">Http_</a><E>) -> Self</h4></section></summary><div class="docblock"><p>Start a new builder, wrapping an incoming stream and low-level options.</p>
|
||
<p>For a more convenient constructor, see <a href="struct.Server.html#method.bind" title="associated function hyper::server::Server::bind"><code>Server::bind</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_keepalive" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#253-256">source</a><h4 class="code-header">pub fn <a href="#method.http1_keepalive" class="fn">http1_keepalive</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets whether to use keep-alive for HTTP/1 connections.</p>
|
||
<p>Default is <code>true</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_half_close" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#268-271">source</a><h4 class="code-header">pub fn <a href="#method.http1_half_close" class="fn">http1_half_close</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set whether HTTP/1 connections should support half-closures.</p>
|
||
<p>Clients can chose to shutdown their write-side while waiting
|
||
for the server to respond. Setting this to <code>true</code> will
|
||
prevent closing the connection immediately if <code>read</code>
|
||
detects an EOF in the middle of a request.</p>
|
||
<p>Default is <code>false</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_max_buf_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#278-281">source</a><h4 class="code-header">pub fn <a href="#method.http1_max_buf_size" class="fn">http1_max_buf_size</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Set the maximum buffer size.</p>
|
||
<p>Default is ~ 400kb.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_writev" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#307-310">source</a><h4 class="code-header">pub fn <a href="#method.http1_writev" class="fn">http1_writev</a>(self, enabled: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set whether HTTP/1 connections should try to use vectored writes,
|
||
or always flatten into a single buffer.</p>
|
||
<p>Note that setting this to false may mean more copies of body data,
|
||
but may also improve performance when an IO transport doesn’t
|
||
support vectored writes well, such as most TLS implementations.</p>
|
||
<p>Setting this to true will force hyper to use queued strategy
|
||
which may eliminate unnecessary cloning on some TLS backends</p>
|
||
<p>Default is <code>auto</code>. In this mode hyper will try to guess which
|
||
mode to use</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_title_case_headers" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#320-323">source</a><h4 class="code-header">pub fn <a href="#method.http1_title_case_headers" class="fn">http1_title_case_headers</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set whether HTTP/1 connections will write header names as title case at
|
||
the socket level.</p>
|
||
<p>Note that this setting does not affect HTTP/2.</p>
|
||
<p>Default is false.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_preserve_header_case" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#340-343">source</a><h4 class="code-header">pub fn <a href="#method.http1_preserve_header_case" class="fn">http1_preserve_header_case</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set whether to support preserving original header cases.</p>
|
||
<p>Currently, this will record the original cases received, and store them
|
||
in a private extension on the <code>Request</code>. It will also look for and use
|
||
such an extension in any provided <code>Response</code>.</p>
|
||
<p>Since the relevant extension is still private, there is no way to
|
||
interact with the original cases. The only effect this can have now is
|
||
to forward the cases in a proxy-like fashion.</p>
|
||
<p>Note that this setting does not affect HTTP/2.</p>
|
||
<p>Default is false.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_header_read_timeout" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#351-354">source</a><h4 class="code-header">pub fn <a href="#method.http1_header_read_timeout" class="fn">http1_header_read_timeout</a>(self, read_timeout: <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> Self</h4></section></summary><div class="docblock"><p>Set a timeout for reading client request headers. If a client does not
|
||
transmit the entire header within this time, the connection is closed.</p>
|
||
<p>Default is None.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http1_only" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#361-364">source</a><h4 class="code-header">pub fn <a href="#method.http1_only" class="fn">http1_only</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets whether HTTP/1 is required.</p>
|
||
<p>Default is <code>false</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_only" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#371-374">source</a><h4 class="code-header">pub fn <a href="#method.http2_only" class="fn">http2_only</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets whether HTTP/2 is required.</p>
|
||
<p>Default is <code>false</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_max_pending_accept_reset_streams" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#383-386">source</a><h4 class="code-header">pub fn <a href="#method.http2_max_pending_accept_reset_streams" class="fn">http2_max_pending_accept_reset_streams</a>(
|
||
self,
|
||
max: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>>>
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.</p>
|
||
<p>This will default to whatever the default in h2 is. As of v0.3.17, it is 20.</p>
|
||
<p>See <a href="https://github.com/hyperium/hyper/issues/2877">https://github.com/hyperium/hyper/issues/2877</a> for more information.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_initial_stream_window_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#398-401">source</a><h4 class="code-header">pub fn <a href="#method.http2_initial_stream_window_size" class="fn">http2_initial_stream_window_size</a>(
|
||
self,
|
||
sz: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>>>
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Sets the <a href="https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE"><code>SETTINGS_INITIAL_WINDOW_SIZE</code></a> option for HTTP2
|
||
stream-level flow control.</p>
|
||
<p>Passing <code>None</code> will do nothing.</p>
|
||
<p>If not set, hyper will use a default.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_initial_connection_window_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#410-414">source</a><h4 class="code-header">pub fn <a href="#method.http2_initial_connection_window_size" class="fn">http2_initial_connection_window_size</a>(
|
||
self,
|
||
sz: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>>>
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Sets the max connection-level flow control for HTTP2</p>
|
||
<p>Passing <code>None</code> will do nothing.</p>
|
||
<p>If not set, hyper will use a default.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_adaptive_window" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#423-426">source</a><h4 class="code-header">pub fn <a href="#method.http2_adaptive_window" class="fn">http2_adaptive_window</a>(self, enabled: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets whether to use an adaptive flow control.</p>
|
||
<p>Enabling this will override the limits set in
|
||
<code>http2_initial_stream_window_size</code> and
|
||
<code>http2_initial_connection_window_size</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_max_frame_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#435-438">source</a><h4 class="code-header">pub fn <a href="#method.http2_max_frame_size" class="fn">http2_max_frame_size</a>(self, sz: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>>>) -> Self</h4></section></summary><div class="docblock"><p>Sets the maximum frame size to use for HTTP2.</p>
|
||
<p>Passing <code>None</code> will do nothing.</p>
|
||
<p>If not set, hyper will use a default.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_max_header_list_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#445-448">source</a><h4 class="code-header">pub fn <a href="#method.http2_max_header_list_size" class="fn">http2_max_header_list_size</a>(self, max: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets the max size of received header frames.</p>
|
||
<p>Default is currently ~16MB, but may change.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_max_concurrent_streams" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#458-461">source</a><h4 class="code-header">pub fn <a href="#method.http2_max_concurrent_streams" class="fn">http2_max_concurrent_streams</a>(self, max: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>>>) -> Self</h4></section></summary><div class="docblock"><p>Sets the <a href="https://http2.github.io/http2-spec/#SETTINGS_MAX_CONCURRENT_STREAMS"><code>SETTINGS_MAX_CONCURRENT_STREAMS</code></a> option for HTTP2
|
||
connections.</p>
|
||
<p>Default is no limit (<code>std::u32::MAX</code>). Passing <code>None</code> will do nothing.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_keep_alive_interval" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#475-478">source</a><h4 class="code-header">pub fn <a href="#method.http2_keep_alive_interval" class="fn">http2_keep_alive_interval</a>(
|
||
self,
|
||
interval: impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>>
|
||
) -> Self</h4></section></summary><div class="docblock"><p>Sets an interval for HTTP2 Ping frames should be sent to keep a
|
||
connection alive.</p>
|
||
<p>Pass <code>None</code> to disable HTTP2 keep-alive.</p>
|
||
<p>Default is currently disabled.</p>
|
||
<h5 id="cargo-feature"><a href="#cargo-feature">Cargo Feature</a></h5>
|
||
<p>Requires the <code>runtime</code> cargo feature to be enabled.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_keep_alive_timeout" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#492-495">source</a><h4 class="code-header">pub fn <a href="#method.http2_keep_alive_timeout" class="fn">http2_keep_alive_timeout</a>(self, timeout: <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -> Self</h4></section></summary><div class="docblock"><p>Sets a timeout for receiving an acknowledgement of the keep-alive ping.</p>
|
||
<p>If the ping is not acknowledged within the timeout, the connection will
|
||
be closed. Does nothing if <code>http2_keep_alive_interval</code> is disabled.</p>
|
||
<p>Default is 20 seconds.</p>
|
||
<h5 id="cargo-feature-1"><a href="#cargo-feature-1">Cargo Feature</a></h5>
|
||
<p>Requires the <code>runtime</code> cargo feature to be enabled.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_max_send_buf_size" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#506-509">source</a><h4 class="code-header">pub fn <a href="#method.http2_max_send_buf_size" class="fn">http2_max_send_buf_size</a>(self, max: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Set the maximum write buffer size for each HTTP/2 stream.</p>
|
||
<p>Default is currently ~400KB, but may change.</p>
|
||
<h5 id="panics"><a href="#panics">Panics</a></h5>
|
||
<p>The value must be no larger than <code>u32::MAX</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.http2_enable_connect_protocol" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#515-518">source</a><h4 class="code-header">pub fn <a href="#method.http2_enable_connect_protocol" class="fn">http2_enable_connect_protocol</a>(self) -> Self</h4></section></summary><div class="docblock"><p>Enables the <a href="https://datatracker.ietf.org/doc/html/rfc8441#section-4">extended CONNECT protocol</a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.executor" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#523-528">source</a><h4 class="code-header">pub fn <a href="#method.executor" class="fn">executor</a><E2>(self, executor: E2) -> <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E2></h4></section></summary><div class="docblock"><p>Sets the <code>Executor</code> to deal with connection tasks.</p>
|
||
<p>Default is <code>tokio::spawn</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.serve" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#560-577">source</a><h4 class="code-header">pub fn <a href="#method.serve" class="fn">serve</a><S, B>(self, make_service: S) -> <a class="struct" href="struct.Server.html" title="struct hyper::server::Server">Server</a><I, S, E> <a href="#" class="tooltip" data-notable-ty="Server<I, S, E>">ⓘ</a><div class="where">where
|
||
I: <a class="trait" href="accept/trait.Accept.html" title="trait hyper::server::accept::Accept">Accept</a>,
|
||
I::<a class="associatedtype" href="accept/trait.Accept.html#associatedtype.Error" title="type hyper::server::accept::Accept::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html" title="trait core::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>>>,
|
||
I::<a class="associatedtype" href="accept/trait.Accept.html#associatedtype.Conn" title="type hyper::server::accept::Accept::Conn">Conn</a>: <a class="trait" href="../../tokio/io/async_read/trait.AsyncRead.html" title="trait tokio::io::async_read::AsyncRead">AsyncRead</a> + <a class="trait" href="../../tokio/io/async_write/trait.AsyncWrite.html" title="trait tokio::io::async_write::AsyncWrite">AsyncWrite</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
|
||
S: MakeServiceRef<I::<a class="associatedtype" href="accept/trait.Accept.html#associatedtype.Conn" title="type hyper::server::accept::Accept::Conn">Conn</a>, <a class="struct" href="../body/struct.Body.html" title="struct hyper::body::Body">Body</a>, ResBody = B>,
|
||
S::Error: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html" title="trait core::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>>>,
|
||
B: <a class="trait" href="../body/trait.HttpBody.html" title="trait hyper::body::HttpBody">HttpBody</a> + 'static,
|
||
B::<a class="associatedtype" href="../body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html" title="trait core::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>>>,
|
||
E: NewSvcExec<I::<a class="associatedtype" href="accept/trait.Accept.html#associatedtype.Conn" title="type hyper::server::accept::Accept::Conn">Conn</a>, S::Future, S::Service, E, NoopWatcher> + ConnStreamExec<<S::Service as HttpService<<a class="struct" href="../body/struct.Body.html" title="struct hyper::body::Body">Body</a>>>::Future, B>,</div></h4></section></summary><div class="docblock"><p>Consume this <code>Builder</code>, creating a <a href="struct.Server.html" title="struct hyper::server::Server"><code>Server</code></a>.</p>
|
||
<h5 id="example"><a href="#example">Example</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>hyper::{Body, Error, Response, Server};
|
||
<span class="kw">use </span>hyper::service::{make_service_fn, service_fn};
|
||
|
||
<span class="comment">// Construct our SocketAddr to listen on...
|
||
</span><span class="kw">let </span>addr = ([<span class="number">127</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], <span class="number">3000</span>).into();
|
||
|
||
<span class="comment">// And a MakeService to handle each connection...
|
||
</span><span class="kw">let </span>make_svc = make_service_fn(|<span class="kw">_</span>| <span class="kw">async </span>{
|
||
<span class="prelude-val">Ok</span>::<<span class="kw">_</span>, Error>(service_fn(|_req| <span class="kw">async </span>{
|
||
<span class="prelude-val">Ok</span>::<<span class="kw">_</span>, Error>(Response::new(Body::from(<span class="string">"Hello World"</span>)))
|
||
}))
|
||
});
|
||
|
||
<span class="comment">// Then bind and serve...
|
||
</span><span class="kw">let </span>server = Server::bind(<span class="kw-2">&</span>addr)
|
||
.serve(make_svc);
|
||
|
||
<span class="comment">// Run forever-ish...
|
||
</span><span class="kw">if let </span><span class="prelude-val">Err</span>(err) = server.<span class="kw">await </span>{
|
||
<span class="macro">eprintln!</span>(<span class="string">"server error: {}"</span>, err);
|
||
}</code></pre></div>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Builder%3CAddrIncoming,+E%3E" class="impl"><a class="src rightside" href="../../src/hyper/server/server.rs.html#585-632">source</a><a href="#impl-Builder%3CAddrIncoming,+E%3E" class="anchor">§</a><h3 class="code-header">impl<E> <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><<a class="struct" href="conn/struct.AddrIncoming.html" title="struct hyper::server::conn::AddrIncoming">AddrIncoming</a>, E></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.tcp_keepalive" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#589-592">source</a><h4 class="code-header">pub fn <a href="#method.tcp_keepalive" class="fn">tcp_keepalive</a>(self, keepalive: <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> Self</h4></section></summary><div class="docblock"><p>Set the duration to remain idle before sending TCP keepalive probes.</p>
|
||
<p>If <code>None</code> is specified, keepalive is disabled.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.tcp_keepalive_interval" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#596-599">source</a><h4 class="code-header">pub fn <a href="#method.tcp_keepalive_interval" class="fn">tcp_keepalive_interval</a>(self, interval: <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.76.0/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>>) -> Self</h4></section></summary><div class="docblock"><p>Set the duration between two successive TCP keepalive retransmissions,
|
||
if acknowledgement to the previous keepalive transmission is not received.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.tcp_keepalive_retries" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#602-605">source</a><h4 class="code-header">pub fn <a href="#method.tcp_keepalive_retries" class="fn">tcp_keepalive_retries</a>(self, retries: <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.u32.html">u32</a>>) -> Self</h4></section></summary><div class="docblock"><p>Set the number of retransmissions to be carried out before declaring that remote end is not available.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.tcp_nodelay" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#608-611">source</a><h4 class="code-header">pub fn <a href="#method.tcp_nodelay" class="fn">tcp_nodelay</a>(self, enabled: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set the value of <code>TCP_NODELAY</code> option for accepted connections.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.tcp_sleep_on_accept_errors" class="method"><a class="src rightside" href="../../src/hyper/server/server.rs.html#628-631">source</a><h4 class="code-header">pub fn <a href="#method.tcp_sleep_on_accept_errors" class="fn">tcp_sleep_on_accept_errors</a>(self, val: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><div class="docblock"><p>Set whether to sleep on accept errors.</p>
|
||
<p>A possible scenario is that the process has hit the max open files
|
||
allowed, and so trying to accept a new connection will fail with
|
||
EMFILE. In some cases, it’s preferable to just wait for some time, if
|
||
the application will likely close some files (or connections), and try
|
||
to accept the connection again. If this option is true, the error will
|
||
be logged at the error level, since it is still a big deal, and then
|
||
the listener will sleep for 1 second.</p>
|
||
<p>In other cases, hitting the max open files should be treat similarly
|
||
to being out-of-memory, and simply error (and shutdown). Setting this
|
||
option to false will allow that.</p>
|
||
<p>For more details see <a href="conn/struct.AddrIncoming.html#method.set_sleep_on_errors" title="method hyper::server::conn::AddrIncoming::set_sleep_on_errors"><code>AddrIncoming::set_sleep_on_errors</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-Debug-for-Builder%3CI,+E%3E" class="impl"><a class="src rightside" href="../../src/hyper/server/server.rs.html#45">source</a><a href="#impl-Debug-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>, E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/hyper/server/server.rs.html#45">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.76.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt">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-RefUnwindSafe-for-Builder%3CI,+E%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E><div class="where">where
|
||
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</div></h3></section><section id="impl-Send-for-Builder%3CI,+E%3E" class="impl"><a href="#impl-Send-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E><div class="where">where
|
||
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-Builder%3CI,+E%3E" class="impl"><a href="#impl-Sync-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E><div class="where">where
|
||
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-Unpin-for-Builder%3CI,+E%3E" class="impl"><a href="#impl-Unpin-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E><div class="where">where
|
||
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-Builder%3CI,+E%3E" class="impl"><a href="#impl-UnwindSafe-for-Builder%3CI,+E%3E" class="anchor">§</a><h3 class="code-header">impl<I, E> <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Builder.html" title="struct hyper::server::Builder">Builder</a><I, E><div class="where">where
|
||
E: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,</div></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/1.76.0/src/core/any.rs.html#140">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/1.76.0/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/1.76.0/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/1.76.0/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/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/1.76.0/src/core/borrow.rs.html#208">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/1.76.0/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/1.76.0/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/1.76.0/src/core/borrow.rs.html#210">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/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/1.76.0/src/core/borrow.rs.html#216">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/1.76.0/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/1.76.0/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/1.76.0/src/core/borrow.rs.html#217">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#763">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/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#766">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/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 class="src rightside" href="../../src/tracing/instrument.rs.html#325">source</a><a href="#impl-Instrument-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="../../tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> 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 class="src rightside" href="../../src/tracing/instrument.rs.html#86">source</a><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a href="../../tracing/instrument/trait.Instrument.html#method.instrument" class="fn">instrument</a>(self, span: <a class="struct" href="../../tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'>Instruments this type with the provided <a href="../../tracing/span/struct.Span.html" title="struct tracing::span::Span"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a href="../../tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a class="src rightside" href="../../src/tracing/instrument.rs.html#128">source</a><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a href="../../tracing/instrument/trait.Instrument.html#method.in_current_span" class="fn">in_current_span</a>(self) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'>Instruments this type with the <a href="../../tracing/span/struct.Span.html#method.current" title="associated function tracing::span::Span::current">current</a> <a href="../../tracing/span/struct.Span.html" title="struct tracing::span::Span"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a href="../../tracing/instrument/trait.Instrument.html#method.in_current_span">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/1.76.0/src/core/convert/mod.rs.html#747-749">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/1.76.0/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/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#756">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/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/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#803-805">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/1.76.0/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/1.76.0/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 href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#810">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#788-790">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/1.76.0/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/1.76.0/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 href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.76.0/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/1.76.0/src/core/convert/mod.rs.html#795">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.76.0/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 class="src rightside" href="../../src/tracing/instrument.rs.html#393">source</a><a href="#impl-WithSubscriber-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="../../tracing/instrument/trait.WithSubscriber.html" title="trait tracing::instrument::WithSubscriber">WithSubscriber</a> 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 class="src rightside" href="../../src/tracing/instrument.rs.html#176-178">source</a><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a href="../../tracing/instrument/trait.WithSubscriber.html#method.with_subscriber" class="fn">with_subscriber</a><S>(self, subscriber: S) -> <a class="struct" href="../../tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self><div class="where">where
|
||
S: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../../tracing_core/dispatcher/struct.Dispatch.html" title="struct tracing_core::dispatcher::Dispatch">Dispatch</a>>,</div></h4></section></summary><div class='docblock'>Attaches the provided <a href="../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
<a href="../../tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="../../tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a class="src rightside" href="../../src/tracing/instrument.rs.html#228">source</a><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a href="../../tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" class="fn">with_current_subscriber</a>(self) -> <a class="struct" href="../../tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><div class='docblock'>Attaches the current <a href="../../tracing/dispatcher/index.html#setting-the-default-subscriber" title="mod tracing::dispatcher">default</a> <a href="../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
|
||
<a href="../../tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="../../tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Server<I, S, E>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Server.html\" title=\"struct hyper::server::Server\">Server</a><I, S, E></code></h3><pre><code><div class=\"where\">impl<I, IO, IE, S, B, E> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Server.html\" title=\"struct hyper::server::Server\">Server</a><I, S, E><div class=\"where\">where\n I: <a class=\"trait\" href=\"accept/trait.Accept.html\" title=\"trait hyper::server::accept::Accept\">Accept</a><Conn = IO, Error = IE>,\n IE: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html\" title=\"trait core::convert::Into\">Into</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html\" title=\"struct alloc::boxed::Box\">Box</a><dyn <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html\" title=\"trait core::error::Error\">StdError</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>>>,\n IO: <a class=\"trait\" href=\"../../tokio/io/async_read/trait.AsyncRead.html\" title=\"trait tokio::io::async_read::AsyncRead\">AsyncRead</a> + <a class=\"trait\" href=\"../../tokio/io/async_write/trait.AsyncWrite.html\" title=\"trait tokio::io::async_write::AsyncWrite\">AsyncWrite</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> + 'static,\n S: MakeServiceRef<IO, <a class=\"struct\" href=\"../body/struct.Body.html\" title=\"struct hyper::body::Body\">Body</a>, ResBody = B>,\n S::Error: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html\" title=\"trait core::convert::Into\">Into</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html\" title=\"struct alloc::boxed::Box\">Box</a><dyn <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html\" title=\"trait core::error::Error\">StdError</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>>>,\n B: <a class=\"trait\" href=\"../body/trait.HttpBody.html\" title=\"trait hyper::body::HttpBody\">HttpBody</a> + 'static,\n B::<a class=\"associatedtype\" href=\"../body/trait.HttpBody.html#associatedtype.Error\" title=\"type hyper::body::HttpBody::Error\">Error</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html\" title=\"trait core::convert::Into\">Into</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html\" title=\"struct alloc::boxed::Box\">Box</a><dyn <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html\" title=\"trait core::error::Error\">StdError</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a>>>,\n E: ConnStreamExec<<S::Service as HttpService<<a class=\"struct\" href=\"../body/struct.Body.html\" title=\"struct hyper::body::Body\">Body</a>>>::Future, B> + NewSvcExec<IO, S::Future, S::Service, E, NoopWatcher>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.76.0/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"type\" href=\"../type.Result.html\" title=\"type hyper::Result\">Result</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.unit.html\">()</a>>;</div>"}</script></section></div></main></body></html> |