mid coding commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<!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="HTTP client utilities"><title>hyper_util::client - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 client</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module client</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate hyper_<wbr>util</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">hyper_util</a></div><h1>Module <span>client</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/hyper_util/client/mod.rs.html#1-11">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP client utilities</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="legacy/index.html" title="mod hyper_util::client::legacy">legacy</a></dt><dd>Legacy implementations of <code>connect</code> module and <code>Client</code></dd><dt><a class="mod" href="pool/index.html" title="mod hyper_util::client::pool">pool</a></dt><dd>Composable pool services</dd><dt><a class="mod" href="proxy/index.html" title="mod hyper_util::client::proxy">proxy</a></dt><dd>Proxy utilities</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../hyper_util/client/legacy/struct.Builder.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../hyper_util/client/legacy/struct.Builder.html">../../../../hyper_util/client/legacy/struct.Builder.html</a>...</p>
|
||||
<script>location.replace("../../../../hyper_util/client/legacy/struct.Builder.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../hyper_util/client/legacy/struct.Client.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../hyper_util/client/legacy/struct.Client.html">../../../../hyper_util/client/legacy/struct.Client.html</a>...</p>
|
||||
<script>location.replace("../../../../hyper_util/client/legacy/struct.Client.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../hyper_util/client/legacy/struct.Error.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../hyper_util/client/legacy/struct.Error.html">../../../../hyper_util/client/legacy/struct.Error.html</a>...</p>
|
||||
<script>location.replace("../../../../hyper_util/client/legacy/struct.Error.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../hyper_util/client/legacy/struct.ResponseFuture.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../hyper_util/client/legacy/struct.ResponseFuture.html">../../../../hyper_util/client/legacy/struct.ResponseFuture.html</a>...</p>
|
||||
<script>location.replace("../../../../hyper_util/client/legacy/struct.ResponseFuture.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/legacy/connect/fn.capture_connection.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/legacy/connect/fn.capture_connection.html">../../../../../hyper_util/client/legacy/connect/fn.capture_connection.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/legacy/connect/fn.capture_connection.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/legacy/connect/struct.CaptureConnection.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/legacy/connect/struct.CaptureConnection.html">../../../../../hyper_util/client/legacy/connect/struct.CaptureConnection.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/legacy/connect/struct.CaptureConnection.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!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="DNS Resolution used by the `HttpConnector`."><title>hyper_util::client::legacy::connect::dns - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 dns</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dns</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#resolvers-are-services" title="Resolvers are `Service`s">Resolvers are <code>Service</code>s</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>legacy::<wbr>connect</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">hyper_util</a>::<wbr><a href="../../../index.html">client</a>::<wbr><a href="../../index.html">legacy</a>::<wbr><a href="../index.html">connect</a></div><h1>Module <span>dns</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/hyper_util/client/legacy/connect/dns.rs.html#1-360">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>DNS Resolution used by the <code>HttpConnector</code>.</p>
|
||||
<p>This module contains:</p>
|
||||
<ul>
|
||||
<li>A <a href="struct.GaiResolver.html" title="struct hyper_util::client::legacy::connect::dns::GaiResolver"><code>GaiResolver</code></a> that is the default resolver for the <code>HttpConnector</code>.</li>
|
||||
<li>The <code>Name</code> type used as an argument to custom resolvers.</li>
|
||||
</ul>
|
||||
<h2 id="resolvers-are-services"><a class="doc-anchor" href="#resolvers-are-services">§</a>Resolvers are <code>Service</code>s</h2>
|
||||
<p>A resolver is just a
|
||||
<code>Service<Name, Response = impl Iterator<Item = SocketAddr>></code>.</p>
|
||||
<p>A simple resolver that ignores the name and always returns a specific
|
||||
address:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::{convert::Infallible, iter, net::SocketAddr};
|
||||
|
||||
<span class="kw">let </span>resolver = tower::service_fn(|_name| <span class="kw">async </span>{
|
||||
<span class="prelude-val">Ok</span>::<<span class="kw">_</span>, Infallible>(iter::once(SocketAddr::from(([<span class="number">127</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], <span class="number">8080</span>))))
|
||||
});</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.GaiAddrs.html" title="struct hyper_util::client::legacy::connect::dns::GaiAddrs">GaiAddrs</a></dt><dd>An iterator of IP addresses returned from <code>getaddrinfo</code>.</dd><dt><a class="struct" href="struct.GaiFuture.html" title="struct hyper_util::client::legacy::connect::dns::GaiFuture">GaiFuture</a></dt><dd>A future to resolve a name returned by <code>GaiResolver</code>.</dd><dt><a class="struct" href="struct.GaiResolver.html" title="struct hyper_util::client::legacy::connect::dns::GaiResolver">GaiResolver</a></dt><dd>A resolver using blocking <code>getaddrinfo</code> calls in a threadpool.</dd><dt><a class="struct" href="struct.InvalidNameError.html" title="struct hyper_util::client::legacy::connect::dns::InvalidNameError">Invalid<wbr>Name<wbr>Error</a></dt><dd>Error indicating a given string was not a valid domain name.</dd><dt><a class="struct" href="struct.Name.html" title="struct hyper_util::client::legacy::connect::dns::Name">Name</a></dt><dd>A domain name to resolve into IP addresses.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["GaiAddrs","GaiFuture","GaiResolver","InvalidNameError","Name"]};
|
||||
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
@@ -0,0 +1,43 @@
|
||||
<!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="Capture the connection for a given request"><title>capture_connection in hyper_util::client::legacy::connect - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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="#">capture_connection</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">capture_<wbr>connection</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 hyper_<wbr>util::<wbr>client::<wbr>legacy::<wbr>connect</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">legacy</a>::<wbr><a href="index.html">connect</a></div><h1>Function <span class="fn">capture_<wbr>connection</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/hyper_util/client/legacy/connect/capture.rs.html#72-76">Source</a> </span></div><pre class="rust item-decl"><code>pub fn capture_connection<B>(request: &mut Request<B>) -> <a class="struct" href="struct.CaptureConnection.html" title="struct hyper_util::client::legacy::connect::CaptureConnection">CaptureConnection</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Capture the connection for a given request</p>
|
||||
<p>When making a request with Hyper, the underlying connection must implement the <a href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection"><code>Connection</code></a> trait.
|
||||
<a href="fn.capture_connection.html" title="fn hyper_util::client::legacy::connect::capture_connection"><code>capture_connection</code></a> allows a caller to capture the returned <a href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected"><code>Connected</code></a> structure as soon
|
||||
as the connection is established.</p>
|
||||
<p><em>Note</em>: If establishing a connection fails, <a href="struct.CaptureConnection.html#method.connection_metadata" title="method hyper_util::client::legacy::connect::CaptureConnection::connection_metadata"><code>CaptureConnection::connection_metadata</code></a> will always return none.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p><strong>Synchronous access</strong>:
|
||||
The <a href="struct.CaptureConnection.html#method.connection_metadata" title="method hyper_util::client::legacy::connect::CaptureConnection::connection_metadata"><code>CaptureConnection::connection_metadata</code></a> method allows callers to check if a connection has been
|
||||
established. This is ideal for situations where you are certain the connection has already
|
||||
been established (e.g. after the response future has already completed).</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>hyper_util::client::legacy::connect::capture_connection;
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>request = http::Request::builder()
|
||||
.uri(<span class="string">"http://foo.com"</span>)
|
||||
.body(())
|
||||
.unwrap();
|
||||
|
||||
<span class="kw">let </span>captured_connection = capture_connection(<span class="kw-2">&mut </span>request);
|
||||
<span class="comment">// some time later after the request has been sent...
|
||||
</span><span class="kw">let </span>connection_info = captured_connection.connection_metadata();
|
||||
<span class="macro">println!</span>(<span class="string">"we are connected! {:?}"</span>, connection_info.as_ref());</code></pre></div>
|
||||
<p><strong>Asynchronous access</strong>:
|
||||
The <a href="struct.CaptureConnection.html#method.wait_for_connection_metadata" title="method hyper_util::client::legacy::connect::CaptureConnection::wait_for_connection_metadata"><code>CaptureConnection::wait_for_connection_metadata</code></a> method returns a future resolves as soon as the
|
||||
connection is available.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>hyper_util::client::legacy::connect::capture_connection;
|
||||
<span class="kw">use </span>hyper_util::client::legacy::Client;
|
||||
<span class="kw">use </span>hyper_util::rt::TokioExecutor;
|
||||
<span class="kw">use </span>bytes::Bytes;
|
||||
<span class="kw">use </span>http_body_util::Empty;
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>request = http::Request::builder()
|
||||
.uri(<span class="string">"http://foo.com"</span>)
|
||||
.body(Empty::<Bytes>::new())
|
||||
.unwrap();
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>captured = capture_connection(<span class="kw-2">&mut </span>request);
|
||||
tokio::task::spawn(<span class="kw">async move </span>{
|
||||
<span class="kw">let </span>connection_info = captured.wait_for_connection_metadata().<span class="kw">await</span>;
|
||||
<span class="macro">println!</span>(<span class="string">"we are connected! {:?}"</span>, connection_info.as_ref());
|
||||
});
|
||||
|
||||
<span class="kw">let </span>client = Client::builder(TokioExecutor::new()).build_http();
|
||||
client.request(request).<span class="kw">await</span>.expect(<span class="string">"request failed"</span>);</code></pre></div></div></details></section></div></main></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/legacy/connect/struct.HttpConnector.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/legacy/connect/struct.HttpConnector.html">../../../../../hyper_util/client/legacy/connect/struct.HttpConnector.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/legacy/connect/struct.HttpConnector.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/legacy/connect/struct.HttpInfo.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/legacy/connect/struct.HttpInfo.html">../../../../../hyper_util/client/legacy/connect/struct.HttpInfo.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/legacy/connect/struct.HttpInfo.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,48 @@
|
||||
<!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="Connectors used by the `Client`."><title>hyper_util::client::legacy::connect - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 connect</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module connect</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#connectors" title="Connectors">Connectors</a><ul><li><a href="#custom-connectors" title="Custom Connectors">Custom Connectors</a></li></ul></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>legacy</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">legacy</a></div><h1>Module <span>connect</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/hyper_util/client/legacy/connect/mod.rs.html#1-444">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Connectors used by the <code>Client</code>.</p>
|
||||
<p>This module contains:</p>
|
||||
<ul>
|
||||
<li>A default <a href="struct.HttpConnector.html" title="struct hyper_util::client::legacy::connect::HttpConnector"><code>HttpConnector</code></a> that does DNS resolution and establishes
|
||||
connections over TCP.</li>
|
||||
<li>Types to build custom connectors.</li>
|
||||
</ul>
|
||||
<h2 id="connectors"><a class="doc-anchor" href="#connectors">§</a>Connectors</h2>
|
||||
<p>A “connector” is a <a href="tower_service::Service"><code>Service</code></a> that takes a <a href="::http::Uri"><code>Uri</code></a> destination, and
|
||||
its <code>Response</code> is some type implementing <a href="hyper::rt::Read"><code>Read</code></a>, <a href="hyper::rt::Write"><code>Write</code></a>,
|
||||
and <a href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection"><code>Connection</code></a>.</p>
|
||||
<h3 id="custom-connectors"><a class="doc-anchor" href="#custom-connectors">§</a>Custom Connectors</h3>
|
||||
<p>A simple connector that ignores the <code>Uri</code> destination and always returns
|
||||
a TCP connection to the same address could be written like this:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>connector = tower::service_fn(|_dst| <span class="kw">async </span>{
|
||||
tokio::net::TcpStream::connect(<span class="string">"127.0.0.1:1337"</span>)
|
||||
})</code></pre></div>
|
||||
<p>Or, fully written out:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::{future::Future, net::SocketAddr, pin::Pin, task::{<span class="self">self</span>, Poll}};
|
||||
<span class="kw">use </span>http::Uri;
|
||||
<span class="kw">use </span>tokio::net::TcpStream;
|
||||
<span class="kw">use </span>tower_service::Service;
|
||||
|
||||
<span class="attr">#[derive(Clone)]
|
||||
</span><span class="kw">struct </span>LocalConnector;
|
||||
|
||||
<span class="kw">impl </span>Service<Uri> <span class="kw">for </span>LocalConnector {
|
||||
<span class="kw">type </span>Response = TcpStream;
|
||||
<span class="kw">type </span>Error = std::io::Error;
|
||||
<span class="comment">// We can't "name" an `async` generated future.
|
||||
</span><span class="kw">type </span>Future = Pin<Box<
|
||||
<span class="kw">dyn </span>Future<Output = <span class="prelude-ty">Result</span><<span class="self">Self</span>::Response, <span class="self">Self</span>::Error>> + Send
|
||||
>>;
|
||||
|
||||
<span class="kw">fn </span>poll_ready(<span class="kw-2">&mut </span><span class="self">self</span>, <span class="kw">_</span>: <span class="kw-2">&mut </span>task::Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> {
|
||||
<span class="comment">// This connector is always ready, but others might not be.
|
||||
</span>Poll::Ready(<span class="prelude-val">Ok</span>(()))
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>call(<span class="kw-2">&mut </span><span class="self">self</span>, <span class="kw">_</span>: Uri) -> <span class="self">Self</span>::Future {
|
||||
Box::pin(TcpStream::connect(SocketAddr::from(([<span class="number">127</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>], <span class="number">1337</span>))))
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>It’s worth noting that for <code>TcpStream</code>s, the <a href="struct.HttpConnector.html" title="struct hyper_util::client::legacy::connect::HttpConnector"><code>HttpConnector</code></a> is a
|
||||
better starting place to extend from.</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="dns/index.html" title="mod hyper_util::client::legacy::connect::dns">dns</a></dt><dd>DNS Resolution used by the <code>HttpConnector</code>.</dd><dt><a class="mod" href="proxy/index.html" title="mod hyper_util::client::legacy::connect::proxy">proxy</a></dt><dd>Proxy helpers</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.CaptureConnection.html" title="struct hyper_util::client::legacy::connect::CaptureConnection">Capture<wbr>Connection</a></dt><dd><a href="struct.CaptureConnection.html" title="struct hyper_util::client::legacy::connect::CaptureConnection"><code>CaptureConnection</code></a> allows callers to capture <a href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected"><code>Connected</code></a> information</dd><dt><a class="struct" href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected">Connected</a></dt><dd>Extra information about the connected transport.</dd><dt><a class="struct" href="struct.HttpConnector.html" title="struct hyper_util::client::legacy::connect::HttpConnector">Http<wbr>Connector</a></dt><dd>A connector for the <code>http</code> scheme.</dd><dt><a class="struct" href="struct.HttpInfo.html" title="struct hyper_util::client::legacy::connect::HttpInfo">Http<wbr>Info</a></dt><dd>Extra information about the transport when an HttpConnector is used.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Connect.html" title="trait hyper_util::client::legacy::connect::Connect">Connect</a></dt><dd>Connect to a destination, returning an IO transport.</dd><dt><a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a></dt><dd>Describes a type returned by a connector.</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.capture_connection.html" title="fn hyper_util::client::legacy::connect::capture_connection">capture_<wbr>connection</a></dt><dd>Capture the connection for a given request</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<!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="Proxy helpers"><title>hyper_util::client::legacy::connect::proxy - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 proxy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module proxy</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>legacy::<wbr>connect</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">hyper_util</a>::<wbr><a href="../../../index.html">client</a>::<wbr><a href="../../index.html">legacy</a>::<wbr><a href="../index.html">connect</a></div><h1>Module <span>proxy</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/hyper_util/client/legacy/connect/proxy/mod.rs.html#1-6">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Proxy helpers</p>
|
||||
</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.SocksV4.html" title="struct hyper_util::client::legacy::connect::proxy::SocksV4">SocksV4</a></dt><dd>Tunnel Proxy via SOCKSv4</dd><dt><a class="struct" href="struct.SocksV5.html" title="struct hyper_util::client::legacy::connect::proxy::SocksV5">SocksV5</a></dt><dd>Tunnel Proxy via SOCKSv5</dd><dt><a class="struct" href="struct.Tunnel.html" title="struct hyper_util::client::legacy::connect::proxy::Tunnel">Tunnel</a></dt><dd>Tunnel Proxy via HTTP CONNECT</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["SocksV4","SocksV5","Tunnel"]};
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV4.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV4.html">../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV4.html</a>...</p>
|
||||
<script>location.replace("../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV4.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV5.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV5.html">../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV5.html</a>...</p>
|
||||
<script>location.replace("../../../../../../../hyper_util/client/legacy/connect/proxy/struct.SocksV5.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
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
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../../hyper_util/client/legacy/connect/proxy/struct.Tunnel.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../../hyper_util/client/legacy/connect/proxy/struct.Tunnel.html">../../../../../../hyper_util/client/legacy/connect/proxy/struct.Tunnel.html</a>...</p>
|
||||
<script>location.replace("../../../../../../hyper_util/client/legacy/connect/proxy/struct.Tunnel.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/legacy/connect/trait.Connect.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/legacy/connect/trait.Connect.html">../../../../../hyper_util/client/legacy/connect/trait.Connect.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/legacy/connect/trait.Connect.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["capture_connection"],"mod":["dns","proxy"],"struct":["CaptureConnection","Connected","HttpConnector","HttpInfo"],"trait":["Connect","Connection"]};
|
||||
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
@@ -0,0 +1,12 @@
|
||||
<!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="Connect to a destination, returning an IO transport."><title>Connect in hyper_util::client::legacy::connect - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 trait"><!--[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="#">Connect</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Connect</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#trait-alias" title="Trait Alias">Trait Alias</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In hyper_<wbr>util::<wbr>client::<wbr>legacy::<wbr>connect</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">legacy</a>::<wbr><a href="index.html">connect</a></div><h1>Trait <span class="trait">Connect</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/hyper_util/client/legacy/connect/mod.rs.html#324-329">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Connect: Sealed + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> { }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Connect to a destination, returning an IO transport.</p>
|
||||
<p>A connector receives a <a href="::http::Uri"><code>Uri</code></a> and returns a <code>Future</code> of the
|
||||
ready connection.</p>
|
||||
<h2 id="trait-alias"><a class="doc-anchor" href="#trait-alias">§</a>Trait Alias</h2>
|
||||
<p>This is really just an <em>alias</em> for the <code>tower::Service</code> trait, with
|
||||
additional bounds set for convenience <em>inside</em> hyper. You don’t actually
|
||||
implement this trait, but <code>tower::Service<Uri></code> instead.</p>
|
||||
</div></details><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.93.0/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Connect-for-S" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/mod.rs.html#339-351">Source</a><a href="#impl-Connect-for-S" class="anchor">§</a><h3 class="code-header">impl<S, T> <a class="trait" href="trait.Connect.html" title="trait hyper_util::client::legacy::connect::Connect">Connect</a> for S<div class="where">where
|
||||
S: Service<Uri, Response = T> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
|
||||
S::Error: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.93.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/error/trait.Error.html" title="trait core::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>>>,
|
||||
S::Future: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||||
T: Read + Write + <a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,</div></h3></section></div><script src="../../../../trait.impl/hyper_util/client/legacy/connect/sealed/trait.Connect.js" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<!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="Describes a type returned by a connector."><title>Connection in hyper_util::client::legacy::connect - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 trait"><!--[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="#">Connection</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Connection</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.connected" title="connected">connected</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Connection-for-TcpStream" title="TcpStream">TcpStream</a></li><li><a href="#impl-Connection-for-UnixStream" title="UnixStream">UnixStream</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In hyper_<wbr>util::<wbr>client::<wbr>legacy::<wbr>connect</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">legacy</a>::<wbr><a href="index.html">connect</a></div><h1>Trait <span class="trait">Connection</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/hyper_util/client/legacy/connect/mod.rs.html#91-94">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Connection {
|
||||
// Required method
|
||||
fn <a href="#tymethod.connected" class="fn">connected</a>(&self) -> <a class="struct" href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected">Connected</a>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Describes a type returned by a connector.</p>
|
||||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.connected" class="method"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/mod.rs.html#93">Source</a><h4 class="code-header">fn <a href="#tymethod.connected" class="fn">connected</a>(&self) -> <a class="struct" href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected">Connected</a></h4></section></summary><div class="docblock"><p>Return metadata describing the connection.</p>
|
||||
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Connection-for-TcpStream" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/http.rs.html#569-581">Source</a><a href="#impl-Connection-for-TcpStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a> for TcpStream</h3></section></summary><div class="impl-items"><section id="method.connected" class="method trait-impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/http.rs.html#570-580">Source</a><a href="#method.connected" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.connected" class="fn">connected</a>(&self) -> <a class="struct" href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected">Connected</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Connection-for-UnixStream" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/http.rs.html#584-588">Source</a><a href="#impl-Connection-for-UnixStream" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a> for UnixStream</h3><span class="item-info"><div class="stab portability">Available on <strong>Unix</strong> only.</div></span></section></summary><div class="impl-items"><section id="method.connected-1" class="method trait-impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/http.rs.html#585-587">Source</a><a href="#method.connected-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.connected" class="fn">connected</a>(&self) -> <a class="struct" href="struct.Connected.html" title="struct hyper_util::client::legacy::connect::Connected">Connected</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Connection-for-TokioIo%3CT%3E" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/legacy/connect/http.rs.html#599-606">Source</a><a href="#impl-Connection-for-TokioIo%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a> for <a class="struct" href="../../../rt/tokio/struct.TokioIo.html" title="struct hyper_util::rt::tokio::TokioIo">TokioIo</a><T><div class="where">where
|
||||
T: <a class="trait" href="trait.Connection.html" title="trait hyper_util::client::legacy::connect::Connection">Connection</a>,</div></h3></section></div><script src="../../../../trait.impl/hyper_util/client/legacy/connect/trait.Connection.js" data-ignore-extern-crates="tokio" async></script></section></div></main></body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<!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="Legacy implementations of `connect` module and `Client`"><title>hyper_util::client::legacy - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 legacy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module legacy</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client</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">hyper_util</a>::<wbr><a href="../index.html">client</a></div><h1>Module <span>legacy</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/hyper_util/client/legacy/mod.rs.html#1-10">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Legacy implementations of <code>connect</code> module and <code>Client</code></p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="connect/index.html" title="mod hyper_util::client::legacy::connect">connect</a></dt><dd>Connectors used by the <code>Client</code>.</dd></dl><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 hyper_util::client::legacy::Builder">Builder</a></dt><dd>A builder to configure a new <a href="struct.Client.html" title="struct hyper_util::client::legacy::Client"><code>Client</code></a>.</dd><dt><a class="struct" href="struct.Client.html" title="struct hyper_util::client::legacy::Client">Client</a></dt><dd>A Client to make outgoing HTTP requests.</dd><dt><a class="struct" href="struct.Error.html" title="struct hyper_util::client::legacy::Error">Error</a></dt><dd>Client errors</dd><dt><a class="struct" href="struct.ResponseFuture.html" title="struct hyper_util::client::legacy::ResponseFuture">Response<wbr>Future</a></dt><dd>A <code>Future</code> that will resolve to an HTTP Response.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["connect"],"struct":["Builder","Client","Error","ResponseFuture"]};
|
||||
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
@@ -0,0 +1,2 @@
|
||||
<!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="Start a builder to construct a `Cache` pool."><title>builder in hyper_util::client::pool::cache - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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="#">builder</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool::<wbr>cache</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a>::<wbr><a href="index.html">cache</a></div><h1>Function <span class="fn">builder</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/hyper_util/client/pool/cache.rs.html#35-39">Source</a> </span></div><pre class="rust item-decl"><code>pub fn builder() -> Builder<Ignore></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Start a builder to construct a <code>Cache</code> pool.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!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 cache of services"><title>hyper_util::client::pool::cache - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 cache</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module cache</a></h2><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a></div><h1>Module <span>cache</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/hyper_util/client/pool/cache.rs.html#1-495">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A cache of services</p>
|
||||
<p>The cache is a single list of cached services, bundled with a <code>MakeService</code>.
|
||||
Calling the cache returns either an existing service, or makes a new one.
|
||||
The returned <code>impl Service</code> can be used to send requests, and when dropped,
|
||||
it will try to be returned back to the cache.</p>
|
||||
</div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.builder.html" title="fn hyper_util::client::pool::cache::builder">builder</a></dt><dd>Start a builder to construct a <code>Cache</code> pool.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/pool/cache/fn.builder.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/pool/cache/fn.builder.html">../../../../../hyper_util/client/pool/cache/fn.builder.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/pool/cache/fn.builder.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["builder"]};
|
||||
@@ -0,0 +1,5 @@
|
||||
<!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="Composable pool services"><title>hyper_util::client::pool - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 pool</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pool</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client</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">hyper_util</a>::<wbr><a href="../index.html">client</a></div><h1>Module <span>pool</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/hyper_util/client/pool/mod.rs.html#1-10">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Composable pool services</p>
|
||||
<p>This module contains various concepts of a connection pool separated into
|
||||
their own concerns. This allows for users to compose the layers, along with
|
||||
any other layers, when constructing custom connection pools.</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="cache/index.html" title="mod hyper_util::client::pool::cache">cache</a></dt><dd>A cache of services</dd><dt><a class="mod" href="map/index.html" title="mod hyper_util::client::pool::map">map</a></dt><dd>Map pool utilities</dd><dt><a class="mod" href="negotiate/index.html" title="mod hyper_util::client::pool::negotiate">negotiate</a></dt><dd>Negotiate a pool of services</dd><dt><a class="mod" href="singleton/index.html" title="mod hyper_util::client::pool::singleton">singleton</a></dt><dd>Singleton pools</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,16 @@
|
||||
<!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="Map pool utilities"><title>hyper_util::client::pool::map - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 map</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module map</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><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></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a></div><h1>Module <span>map</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/hyper_util/client/pool/map.rs.html#1-226">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Map pool utilities</p>
|
||||
<p>The map isn’t a typical <code>Service</code>, but rather stand-alone type that can map
|
||||
requests to a key and service factory. This is because the service is more
|
||||
of a router, and cannot determine which inner service to check for
|
||||
backpressure since it’s not know until the request is made.</p>
|
||||
<p>The map implementation allows customization of extracting a key, and how to
|
||||
construct a MakeService for that key.</p>
|
||||
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>map = pool::map::Map::builder()
|
||||
.keys(|uri| (uri.scheme().clone(), uri.authority().clone()))
|
||||
.values(|_uri| {
|
||||
some_http1_connector()
|
||||
})
|
||||
.build();
|
||||
|
||||
<span class="kw">let </span>resp = map.service(req.uri()).call(req).<span class="kw">await</span>;</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.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a></dt><dd>A map caching <code>MakeService</code>s per key.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["Map"]};
|
||||
@@ -0,0 +1,42 @@
|
||||
<!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 map caching `MakeService`s per key."><title>Map in hyper_util::client::pool::map - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 struct"><!--[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="#">Map</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Map</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.builder" title="builder">builder</a></li><li><a href="#method.clear" title="clear">clear</a></li><li><a href="#method.retain" title="retain">retain</a></li><li><a href="#method.service" title="service">service</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Map%3CT,+Req%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Map%3CT,+Req%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Map%3CT,+Req%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-Map%3CT,+Req%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Map%3CT,+Req%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Map%3CT,+Req%3E" title="UnwindSafe">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" 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><a href="index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool::<wbr>map</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a>::<wbr><a href="index.html">map</a></div><h1>Struct <span class="struct">Map</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/hyper_util/client/pool/map.rs.html#40-46">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Map<T, Req><div class="where">where
|
||||
T: Target<Req>,</div>{ <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 map caching <code>MakeService</code>s per key.</p>
|
||||
<p>Create one with the <a href="struct.Map.html#method.builder" title="associated function hyper_util::client::pool::map::Map::builder"><code>Map::builder()</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-Map%3CStartHere,+StartHere%3E" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#50-56">Source</a><a href="#impl-Map%3CStartHere,+StartHere%3E" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><StartHere, StartHere></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.builder" class="method"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#52-55">Source</a><h4 class="code-header">pub fn <a href="#method.builder" class="fn">builder</a><Dst>() -> Builder<Dst, WantsKeyer, WantsServiceMaker></h4></section></summary><div class="docblock"><p>Create a [<code>Builder</code>] to configure a new <code>Map</code>.</p>
|
||||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Map%3CT,+Req%3E" class="impl"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#70-95">Source</a><a href="#impl-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: Target<Req>,
|
||||
T::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.service" class="method"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#76-81">Source</a><h4 class="code-header">pub fn <a href="#method.service" class="fn">service</a>(&mut self, req: <a class="primitive" href="https://doc.rust-lang.org/1.93.0/std/primitive.reference.html">&Req</a>) -> &mut T::Service</h4></section></summary><div class="docblock"><p>Get a service after extracting the key from <code>req</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.retain" class="method"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#84-89">Source</a><h4 class="code-header">pub fn <a href="#method.retain" class="fn">retain</a><F>(&mut self, predicate: F)<div class="where">where
|
||||
F: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&T::Key, &mut T::Service) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.0/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Retains only the services specified by the predicate.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.clear" class="method"><a class="src rightside" href="../../../../src/hyper_util/client/pool/map.rs.html#92-94">Source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">clear</a>(&mut self)</h4></section></summary><div class="docblock"><p>Clears the map, removing all key-value pairs.</p>
|
||||
</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-Map%3CT,+Req%3E" class="impl"><a href="#impl-Freeze-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a>,</div></h3></section><section id="impl-RefUnwindSafe-for-Map%3CT,+Req%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||||
<T as Target<Req>>::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||||
<T as Target<Req>>::Service: <a class="trait" href="https://doc.rust-lang.org/1.93.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-Map%3CT,+Req%3E" class="impl"><a href="#impl-Send-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||||
<T as Target<Req>>::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||||
<T as Target<Req>>::Service: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-Map%3CT,+Req%3E" class="impl"><a href="#impl-Sync-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||||
<T as Target<Req>>::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||||
<T as Target<Req>>::Service: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-Unpin-for-Map%3CT,+Req%3E" class="impl"><a href="#impl-Unpin-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||||
<T as Target<Req>>::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||||
<T as Target<Req>>::Service: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-Map%3CT,+Req%3E" class="impl"><a href="#impl-UnwindSafe-for-Map%3CT,+Req%3E" class="anchor">§</a><h3 class="code-header">impl<T, Req> <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Map.html" title="struct hyper_util::client::pool::map::Map">Map</a><T, Req><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||||
<T as Target<Req>>::Key: <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||||
<T as Target<Req>>::Service: <a class="trait" href="https://doc.rust-lang.org/1.93.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.93.0/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/1.93.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.93.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.93.0/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/1.93.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.93.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.93.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.93.0/src/core/borrow.rs.html#212">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.93.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.93.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.93.0/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.93.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.93.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.93.0/src/core/borrow.rs.html#221">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.93.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.93.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.93.0/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.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.93.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.93.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.93.0/src/core/convert/mod.rs.html#785">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.93.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.93.0/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.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 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/1.93.0/src/core/convert/mod.rs.html#767-769">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.93.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.93.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.93.0/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.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.93.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.93.0/src/core/convert/mod.rs.html#827-829">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.93.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.93.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 class="src rightside" href="https://doc.rust-lang.org/1.93.0/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.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.93.0/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.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.93.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.93.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.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.93.0/src/core/convert/mod.rs.html#811-813">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.93.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.93.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 class="src rightside" href="https://doc.rust-lang.org/1.93.0/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.93.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.93.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.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.93.0/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.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.93.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.93.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.93.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 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/1.93.0/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="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></section></div></main></body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
<!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="Start a builder to construct a `Negotiate` pool."><title>builder in hyper_util::client::pool::negotiate - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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="#">builder</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool::<wbr>negotiate</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a>::<wbr><a href="index.html">negotiate</a></div><h1>Function <span class="fn">builder</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/hyper_util/client/pool/negotiate.rs.html#162-169">Source</a> </span></div><pre class="rust item-decl"><code>pub fn builder() -> Builder<WantsConnect, WantsInspect, WantsFallback, WantsUpgrade></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Start a builder to construct a <code>Negotiate</code> pool.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!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="Negotiate a pool of services"><title>hyper_util::client::pool::negotiate - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 negotiate</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module negotiate</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a></div><h1>Module <span>negotiate</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/hyper_util/client/pool/negotiate.rs.html#1-639">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Negotiate a pool of services</p>
|
||||
<p>The negotiate pool allows for a service that can decide between two service
|
||||
types based on an intermediate return value. It differs from typical
|
||||
routing since it doesn’t depend on the request, but the response.</p>
|
||||
<p>The original use case is support ALPN upgrades to HTTP/2, with a fallback
|
||||
to HTTP/1.</p>
|
||||
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>pool = hyper_util::client::pool::negotiate::builder()
|
||||
.connect(some_tls_connector)
|
||||
.inspect(|c| c.negotiated_protocol() == <span class="string">b"h2"</span>)
|
||||
.fallback(http1_layer)
|
||||
.upgrade(http2_layer)
|
||||
.build();
|
||||
|
||||
<span class="comment">// connect
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = pool.call(http::Uri::from_static(<span class="string">"https://hyper.rs"</span>)).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
svc.ready().<span class="kw">await</span>;
|
||||
|
||||
<span class="comment">// http1 or http2 is now set up
|
||||
</span><span class="kw">let </span>resp = svc.call(some_http_req).<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div></div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.builder.html" title="fn hyper_util::client::pool::negotiate::builder">builder</a></dt><dd>Start a builder to construct a <code>Negotiate</code> pool.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../../../hyper_util/client/pool/negotiate/fn.builder.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../../../hyper_util/client/pool/negotiate/fn.builder.html">../../../../../hyper_util/client/pool/negotiate/fn.builder.html</a>...</p>
|
||||
<script>location.replace("../../../../../hyper_util/client/pool/negotiate/fn.builder.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["builder"]};
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["cache","map","negotiate","singleton"]};
|
||||
@@ -0,0 +1,14 @@
|
||||
<!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="Singleton pools"><title>hyper_util::client::pool::singleton - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 singleton</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module singleton</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><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></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>pool</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">pool</a></div><h1>Module <span>singleton</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/hyper_util/client/pool/singleton.rs.html#1-493">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Singleton pools</p>
|
||||
<p>This ensures that only one active connection is made.</p>
|
||||
<p>The singleton pool wraps a <code>MakeService<T, Req></code> so that it only produces a
|
||||
single <code>Service<Req></code>. It bundles all concurrent calls to it, so that only
|
||||
one connection is made. All calls to the singleton will return a clone of
|
||||
the inner service once established.</p>
|
||||
<p>This fits the HTTP/2 case well.</p>
|
||||
<h3 id="example"><a class="doc-anchor" href="#example">§</a>Example</h3>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>pool = Singleton::new(some_make_svc);
|
||||
|
||||
<span class="kw">let </span>svc1 = pool.call(some_dst).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>svc2 = pool.call(some_dst).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="comment">// svc1 == svc2</span></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.Singleton.html" title="struct hyper_util::client::pool::singleton::Singleton">Singleton</a></dt><dd>A singleton pool over an inner service.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["Singleton"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
<!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="Proxy utilities"><title>hyper_util::client::proxy - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 proxy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module proxy</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client</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">hyper_util</a>::<wbr><a href="../index.html">client</a></div><h1>Module <span>proxy</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/hyper_util/client/proxy/mod.rs.html#1-3">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Proxy utilities</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="matcher/index.html" title="mod hyper_util::client::proxy::matcher">matcher</a></dt><dd>Proxy matchers</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!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="Proxy matchers"><title>hyper_util::client::proxy::matcher - 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="hyper_util" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.0 (254b59607 2026-01-19)" data-channel="1.93.0" 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 matcher</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../hyper_util/index.html">hyper_<wbr>util</a><span class="version">0.1.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module matcher</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In hyper_<wbr>util::<wbr>client::<wbr>proxy</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">hyper_util</a>::<wbr><a href="../../index.html">client</a>::<wbr><a href="../index.html">proxy</a></div><h1>Module <span>matcher</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/hyper_util/client/proxy/matcher.rs.html#1-869">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Proxy matchers</p>
|
||||
<p>This module contains different matchers to configure rules for when a proxy
|
||||
should be used, and if so, with what arguments.</p>
|
||||
<p>A <a href="struct.Matcher.html" title="struct hyper_util::client::proxy::matcher::Matcher"><code>Matcher</code></a> can be constructed either using environment variables, or
|
||||
a <a href="struct.Matcher.html#method.builder" title="associated function hyper_util::client::proxy::matcher::Matcher::builder"><code>Matcher::builder()</code></a>.</p>
|
||||
<p>Once constructed, the <code>Matcher</code> can be asked if it intercepts a <code>Uri</code> by
|
||||
calling <a href="struct.Matcher.html#method.intercept" title="method hyper_util::client::proxy::matcher::Matcher::intercept"><code>Matcher::intercept()</code></a>.</p>
|
||||
<p>An <a href="struct.Intercept.html" title="struct hyper_util::client::proxy::matcher::Intercept"><code>Intercept</code></a> includes the destination for the proxy, and any parsed
|
||||
authentication to be used.</p>
|
||||
</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 hyper_util::client::proxy::matcher::Builder">Builder</a></dt><dd>A builder to create a <a href="struct.Matcher.html" title="struct hyper_util::client::proxy::matcher::Matcher"><code>Matcher</code></a>.</dd><dt><a class="struct" href="struct.Intercept.html" title="struct hyper_util::client::proxy::matcher::Intercept">Intercept</a></dt><dd>A matched proxy,</dd><dt><a class="struct" href="struct.Matcher.html" title="struct hyper_util::client::proxy::matcher::Matcher">Matcher</a></dt><dd>A proxy matcher, usually built from environment variables.</dd></dl></section></div></main></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["Builder","Intercept","Matcher"]};
|
||||
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
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["matcher"]};
|
||||
@@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["legacy","pool","proxy"]};
|
||||
Reference in New Issue
Block a user