Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<!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="Creates a new configured HTTP/2 server with default configuration values backed by `io`."><title>handshake in h2::server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="h2" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">handshake</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../h2/index.html">h2</a><span class="version">0.4.13</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">handshake</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In h2::<wbr>server</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">h2</a>::<wbr><a href="index.html">server</a></div><h1>Function <span class="fn">handshake</span>&nbsp;<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/h2/server.rs.html#365-370">Source</a> </span></div><pre class="rust item-decl"><code>pub fn handshake&lt;T&gt;(io: T) -&gt; <a class="struct" href="struct.Handshake.html" title="struct h2::server::Handshake">Handshake</a>&lt;T, <a class="struct" href="../../bytes/bytes/struct.Bytes.html" title="struct bytes::bytes::Bytes">Bytes</a>&gt; <a href="#" class="tooltip" data-notable-ty="Handshake&lt;T, Bytes&gt;"></a><div class="where">where
T: <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.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates a new configured HTTP/2 server with default configuration
values backed by <code>io</code>.</p>
<p>It is expected that <code>io</code> already be in an appropriate state to commence
the <a href="http://httpwg.org/specs/rfc7540.html#ConnectionHeader">HTTP/2 handshake</a>. See <a href="../index.html#handshake">Handshake</a> for more details.</p>
<p>Returns a future which resolves to the <a href="struct.Connection.html"><code>Connection</code></a> instance once the
HTTP/2 handshake has been completed. The returned <a href="struct.Connection.html"><code>Connection</code></a>
instance will be using default configuration values. Use <a href="struct.Builder.html" title="struct h2::server::Builder"><code>Builder</code></a> to
customize the configuration values used by a <a href="struct.Connection.html"><code>Connection</code></a> instance.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>connection = server::handshake(my_io).<span class="kw">await</span>.unwrap();
<span class="comment">// The HTTP/2 handshake has completed, now use `connection` to
// accept inbound HTTP/2 streams.</span></code></pre></div></div></details><script type="text/json" id="notable-traits-data">{"Handshake<T, Bytes>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Handshake.html\" title=\"struct h2::server::Handshake\">Handshake</a>&lt;T, B&gt;</code></h3><pre><code><div class=\"where\">impl&lt;T, B&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"struct.Handshake.html\" title=\"struct h2::server::Handshake\">Handshake</a>&lt;T, B&gt;<div class=\"where\">where\n T: <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.93.1/core/marker/trait.Unpin.html\" title=\"trait core::marker::Unpin\">Unpin</a>,\n B: <a class=\"trait\" href=\"../../bytes/buf/buf_impl/trait.Buf.html\" title=\"trait bytes::buf::buf_impl::Buf\">Buf</a>,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;<a class=\"struct\" href=\"struct.Connection.html\" title=\"struct h2::server::Connection\">Connection</a>&lt;T, B&gt;, <a class=\"struct\" href=\"../struct.Error.html\" title=\"struct h2::Error\">Error</a>&gt;;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,86 @@
<!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 implementation of the HTTP/2 protocol."><title>h2::server - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="h2" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module server</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../h2/index.html">h2</a><span class="version">0.4.13</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module server</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#getting-started" title="Getting started">Getting started</a></li><li><a href="#inbound-streams" title="Inbound streams">Inbound streams</a></li><li><a href="#managing-the-connection" title="Managing the connection">Managing the connection</a></li><li><a href="#shutting-down-the-server" title="Shutting down the server">Shutting down the server</a></li><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate h2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">h2</a></div><h1>Module <span>server</span>&nbsp;<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/h2/server.rs.html#1-1746">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Server implementation of the HTTP/2 protocol.</p>
<h2 id="getting-started"><a class="doc-anchor" href="#getting-started">§</a>Getting started</h2>
<p>Running an HTTP/2 server requires the caller to manage accepting the
connections as well as getting the connections to a state that is ready to
begin the HTTP/2 handshake. See <a href="../index.html#handshake">here</a> for more
details.</p>
<p>This could be as basic as using Tokios <a href="https://docs.rs/tokio-core/0.1/tokio_core/net/struct.TcpListener.html"><code>TcpListener</code></a> to accept
connections, but usually it means using either ALPN or HTTP/1.1 protocol
upgrades.</p>
<p>Once a connection is obtained, it is passed to <a href="fn.handshake.html"><code>handshake</code></a>,
which will begin the <a href="http://httpwg.org/specs/rfc7540.html#ConnectionHeader">HTTP/2 handshake</a>. This returns a future that
completes once the handshake process is performed and HTTP/2 streams may
be received.</p>
<p><a href="fn.handshake.html"><code>handshake</code></a> uses default configuration values. There are a number of
settings that can be changed by using <a href="struct.Builder.html"><code>Builder</code></a> instead.</p>
<h2 id="inbound-streams"><a class="doc-anchor" href="#inbound-streams">§</a>Inbound streams</h2>
<p>The <a href="struct.Connection.html"><code>Connection</code></a> instance is used to accept inbound HTTP/2 streams. It
does this by implementing <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html"><code>futures::Stream</code></a>. When a new stream is
received, a call to <a href="struct.Connection.html#method.accept" title="method h2::server::Connection::accept"><code>Connection::accept</code></a> will return <code>(request, response)</code>.
The <code>request</code> handle (of type <a href="../struct.RecvStream.html"><code>http::Request&lt;RecvStream&gt;</code></a>) contains the
HTTP request head as well as provides a way to receive the inbound data
stream and the trailers. The <code>response</code> handle (of type <a href="struct.SendResponse.html" title="struct h2::server::SendResponse"><code>SendResponse</code></a>)
allows responding to the request, stream the response payload, send
trailers, and send push promises.</p>
<p>The send (<a href="../struct.SendStream.html"><code>SendStream</code></a>) and receive (<a href="../struct.RecvStream.html"><code>RecvStream</code></a>) halves of the stream
can be operated independently.</p>
<h2 id="managing-the-connection"><a class="doc-anchor" href="#managing-the-connection">§</a>Managing the connection</h2>
<p>The <a href="struct.Connection.html"><code>Connection</code></a> instance is used to manage connection state. The caller
is required to call either <a href="struct.Connection.html#method.accept" title="method h2::server::Connection::accept"><code>Connection::accept</code></a> or
<a href="struct.Connection.html#method.poll_close"><code>Connection::poll_close</code></a> in order to advance the connection state. Simply
operating on <a href="../struct.SendStream.html"><code>SendStream</code></a> or <a href="../struct.RecvStream.html"><code>RecvStream</code></a> will have no effect unless the
connection state is advanced.</p>
<p>It is not required to call <strong>both</strong> <a href="struct.Connection.html#method.accept" title="method h2::server::Connection::accept"><code>Connection::accept</code></a> and
<a href="struct.Connection.html#method.poll_close"><code>Connection::poll_close</code></a>. If the caller is ready to accept a new stream,
then only <a href="struct.Connection.html#method.accept" title="method h2::server::Connection::accept"><code>Connection::accept</code></a> should be called. When the caller <strong>does
not</strong> want to accept a new stream, <a href="struct.Connection.html#method.poll_close"><code>Connection::poll_close</code></a> should be
called.</p>
<p>The <a href="struct.Connection.html"><code>Connection</code></a> instance should only be dropped once
<a href="struct.Connection.html#method.poll_close"><code>Connection::poll_close</code></a> returns <code>Ready</code>. Once <a href="struct.Connection.html#method.accept" title="method h2::server::Connection::accept"><code>Connection::accept</code></a>
returns <code>Ready(None)</code>, there will no longer be any more inbound streams. At
this point, only <a href="struct.Connection.html#method.poll_close"><code>Connection::poll_close</code></a> should be called.</p>
<h2 id="shutting-down-the-server"><a class="doc-anchor" href="#shutting-down-the-server">§</a>Shutting down the server</h2>
<p>Graceful shutdown of the server is <a href="https://github.com/hyperium/h2/issues/69">not yet
implemented</a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>A basic HTTP/2 server example that runs over TCP and assumes <a href="http://httpwg.org/specs/rfc7540.html#known-http">prior
knowledge</a>, i.e. both the client and the server assume that the TCP socket
will use the HTTP/2 protocol without prior negotiation.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>h2::server;
<span class="kw">use </span>http::{Response, StatusCode};
<span class="kw">use </span>tokio::net::TcpListener;
<span class="attr">#[tokio::main]
</span><span class="kw">pub async fn </span>main() {
<span class="kw">let </span><span class="kw-2">mut </span>listener = TcpListener::bind(<span class="string">"127.0.0.1:5928"</span>).<span class="kw">await</span>.unwrap();
<span class="comment">// Accept all incoming TCP connections.
</span><span class="kw">loop </span>{
<span class="kw">if let </span><span class="prelude-val">Ok</span>((socket, _peer_addr)) = listener.accept().<span class="kw">await </span>{
<span class="comment">// Spawn a new task to process each connection.
</span>tokio::spawn(<span class="kw">async </span>{
<span class="comment">// Start the HTTP/2 connection handshake
</span><span class="kw">let </span><span class="kw-2">mut </span>h2 = server::handshake(socket).<span class="kw">await</span>.unwrap();
<span class="comment">// Accept all inbound HTTP/2 streams sent over the
// connection.
</span><span class="kw">while let </span><span class="prelude-val">Some</span>(request) = h2.accept().<span class="kw">await </span>{
<span class="kw">let </span>(request, <span class="kw-2">mut </span>respond) = request.unwrap();
<span class="macro">println!</span>(<span class="string">"Received request: {:?}"</span>, request);
<span class="comment">// Build a response with no body
</span><span class="kw">let </span>response = Response::builder()
.status(StatusCode::OK)
.body(())
.unwrap();
<span class="comment">// Send the response back to the client
</span>respond.send_response(response, <span class="bool-val">true</span>)
.unwrap();
}
});
}
}
}</code></pre></div></div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Builder.html" title="struct h2::server::Builder">Builder</a></dt><dd>Builds server connections with custom configuration values.</dd><dt><a class="struct" href="struct.Connection.html" title="struct h2::server::Connection">Connection</a></dt><dd>Accepts inbound HTTP/2 streams on a connection.</dd><dt><a class="struct" href="struct.Handshake.html" title="struct h2::server::Handshake">Handshake</a></dt><dd>In progress HTTP/2 connection handshake future.</dd><dt><a class="struct" href="struct.SendPushedResponse.html" title="struct h2::server::SendPushedResponse">Send<wbr>Pushed<wbr>Response</a></dt><dd>Send a response to a promised request</dd><dt><a class="struct" href="struct.SendResponse.html" title="struct h2::server::SendResponse">Send<wbr>Response</a></dt><dd>Send a response back to the client</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.handshake.html" title="fn h2::server::handshake">handshake</a></dt><dd>Creates a new configured HTTP/2 server with default configuration
values backed by <code>io</code>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["handshake"],"struct":["Builder","Connection","Handshake","SendPushedResponse","SendResponse"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long