Adding large folders

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

File diff suppressed because one or more lines are too long

View File

@@ -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="Builder types to compose layers and services"><title>tower::builder - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module builder</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module builder</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 class="in-crate"><a href="../index.html">In crate tower</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">tower</a></div><h1>Module <span>builder</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/builder/mod.rs.html#1-871">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Builder types to compose layers and services</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.ServiceBuilder.html" title="struct tower::builder::ServiceBuilder">Service<wbr>Builder</a></dt><dd>Declaratively construct <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["ServiceBuilder"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
<!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="Returns a new `ServiceFn` with the given closure."><title>service_fn in tower - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">service_fn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">service_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tower</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">tower</a></div><h1>Function <span class="fn">service_<wbr>fn</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tower/util/service_fn.rs.html#46-48">Source</a> </span></div><pre class="rust item-decl"><code>pub fn service_fn&lt;T&gt;(f: T) -&gt; <a class="struct" href="util/struct.ServiceFn.html" title="struct tower::util::ServiceFn">ServiceFn</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="util/struct.ServiceFn.html" title="struct tower::util::ServiceFn"><code>ServiceFn</code></a> with the given closure.</p>
<p>This lets you build a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> from an async function that returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::{service_fn, Service, ServiceExt, BoxError};
<span class="kw">async fn </span>handle(request: Request) -&gt; <span class="prelude-ty">Result</span>&lt;Response, BoxError&gt; {
<span class="kw">let </span>response = Response::new(<span class="string">"Hello, World!"</span>);
<span class="prelude-val">Ok</span>(response)
}
<span class="kw">let </span><span class="kw-2">mut </span>service = service_fn(handle);
<span class="kw">let </span>response = service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(Request::new())
.<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(<span class="string">"Hello, World!"</span>, response.into_body());</code></pre></div></div></details></section></div></main></body></html>

107
target/doc/tower/index.html Normal file
View File

@@ -0,0 +1,107 @@
<!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="`async fn(Request) -&#62; Result&#60;Response, Error&#62;`"><title>tower - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.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 crate"><!--[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="#">Crate tower</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#overview" title="Overview">Overview</a><ul><li><a href="#the-tower-ecosystem" title="The Tower Ecosystem">The Tower Ecosystem</a></li></ul></li><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#library-support" title="Library Support">Library Support</a></li><li><a href="#getting-started" title="Getting Started">Getting Started</a></li><li><a href="#supported-rust-versions" title="Supported Rust Versions">Supported Rust Versions</a></li></ul></li></ul><h3><a href="#modules">Crate 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><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>Crate <span>tower</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tower/lib.rs.html#1-228">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>async fn(Request) -&gt; Result&lt;Response, Error&gt;</code></p>
<h2 id="overview"><a class="doc-anchor" href="#overview">§</a>Overview</h2>
<p>Tower is a library of modular and reusable components for building
robust networking clients and servers.</p>
<p>Tower provides a simple core abstraction, the <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> trait, which
represents an asynchronous function taking a request and returning either a
response or an error. This abstraction can be used to model both clients and
servers.</p>
<p>Generic components, like <a href="timeout/index.html" title="mod tower::timeout"><code>timeout</code></a>, <a href="crate::limit::rate">rate limiting</a>, and <a href="crate::balance">load balancing</a>,
can be modeled as <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>s that wrap some inner service and apply
additional behavior before or after the inner service is called. This allows
implementing these components in a protocol-agnostic, composable way. Typically,
such services are referred to as <em>middleware</em>.</p>
<p>An additional abstraction, the <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> trait, is used to compose
middleware with <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>s. If a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> can be thought of as an
asynchronous function from a request type to a response type, a <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> is
a function taking a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> of one type and returning a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> of a
different type. The <a href="struct.ServiceBuilder.html" title="struct tower::ServiceBuilder"><code>ServiceBuilder</code></a> type is used to add middleware to a
service by composing it with multiple <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>s.</p>
<h3 id="the-tower-ecosystem"><a class="doc-anchor" href="#the-tower-ecosystem">§</a>The Tower Ecosystem</h3>
<p>Tower is made up of the following crates:</p>
<ul>
<li><a href="https://crates.io/crates/tower"><code>tower</code></a> (this crate)</li>
<li><a href="https://crates.io/crates/tower-service"><code>tower-service</code></a></li>
<li><a href="https://crates.io/crates/tower-layer"><code>tower-layer</code></a></li>
<li><a href="https://crates.io/crates/tower-test"><code>tower-test</code></a></li>
</ul>
<p>Since the <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> and <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> traits are important integration points
for all libraries using Tower, they are kept as stable as possible, and
breaking changes are made rarely. Therefore, they are defined in separate
crates, <a href="https://crates.io/crates/tower-service"><code>tower-service</code></a> and <a href="https://crates.io/crates/tower-layer"><code>tower-layer</code></a>. This crate contains
re-exports of those core traits, implementations of commonly-used
middleware, and <a href="trait.ServiceExt.html" title="trait tower::ServiceExt">utilities</a> for working with <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>s and <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>s.
Finally, the <a href="https://crates.io/crates/tower-test"><code>tower-test</code></a> crate provides tools for testing programs using
Tower.</p>
<h2 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h2>
<p>Tower provides an abstraction layer, and generic implementations of various
middleware. This means that the <code>tower</code> crate on its own does <em>not</em> provide
a working implementation of a network client or server. Instead, Towers
<a href="trait.Service.html" title="trait tower::Service"><code>Service</code> trait</a> provides an integration point between
application code, libraries providing middleware implementations, and
libraries that implement servers and/or clients for various network
protocols.</p>
<p>Depending on your particular use case, you might use Tower in several ways:</p>
<ul>
<li>
<p><strong>Implementing application logic</strong> for a networked program. You might
use the <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> trait to model your applications behavior, and use
the middleware <a href="#modules">provided by this crate</a> and by other libraries
to add functionality to clients and servers provided by one or more
protocol implementations.</p>
</li>
<li>
<p><strong>Implementing middleware</strong> to add custom behavior to network clients and
servers in a reusable manner. This might be general-purpose middleware
(and if it is, please consider releasing your middleware as a library for
other Tower users!) or application-specific behavior that needs to be
shared between multiple clients or servers.</p>
</li>
<li>
<p><strong>Implementing a network protocol</strong>. Libraries that implement network
protocols (such as HTTP) can depend on <code>tower-service</code> to use the
<a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> trait as an integration point between the protocol and user
code. For example, a client for some protocol might implement <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>,
allowing users to add arbitrary Tower middleware to those clients.
Similarly, a server might be created from a user-provided <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</p>
<p>Additionally, when a network protocol requires functionality already
provided by existing Tower middleware, a protocol implementation might use
Tower middleware internally, as well as as an integration point.</p>
</li>
</ul>
<h3 id="library-support"><a class="doc-anchor" href="#library-support">§</a>Library Support</h3>
<p>A number of third-party libraries support Tower and the <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> trait.
The following is an incomplete list of such libraries:</p>
<ul>
<li><a href="https://crates.io/crates/hyper"><code>hyper</code></a>: A fast and correct low-level HTTP implementation.</li>
<li><a href="https://crates.io/crates/tonic"><code>tonic</code></a>: A <a href="https://grpc.io">gRPC-over-HTTP/2</a> implementation built on top of
<a href="https://crates.io/crates/hyper"><code>hyper</code></a>. See <a href="https://github.com/hyperium/tonic/tree/master/examples/src/tower">here</a> for examples of using <a href="https://crates.io/crates/tonic"><code>tonic</code></a> with
Tower.</li>
<li><a href="https://crates.io/crates/warp"><code>warp</code></a>: A lightweight, composable web framework. See
<a href="https://docs.rs/warp/0.2.5/warp/fn.service.html">here</a> for details on using <a href="https://crates.io/crates/warp"><code>warp</code></a> with Tower.</li>
<li><a href="https://crates.io/crates/tower-lsp"><code>tower-lsp</code></a>: implementations of the <a href="https://microsoft.github.io/language-server-protocol/">Language
Server Protocol</a> based on Tower.</li>
</ul>
<p>If youre the maintainer of a crate that supports Tower, wed love to add
your crate to this list! Please <a href="https://github.com/tower-rs/tower/compare">open a PR</a> adding a brief description of
your library!</p>
<h3 id="getting-started"><a class="doc-anchor" href="#getting-started">§</a>Getting Started</h3>
<p>If youre brand new to Tower and want to start with the basics, we recommend you
check out some of our <a href="https://github.com/tower-rs/tower/tree/master/guides">guides</a>.</p>
<p>The various middleware implementations provided by this crate are feature
flagged, so that users can only compile the parts of Tower they need. By
default, all the optional middleware are disabled.</p>
<p>To get started using all of Towers optional middleware, add this to your
<code>Cargo.toml</code>:</p>
<div class="example-wrap"><pre class="language-toml"><code>tower = { version = &quot;0.4&quot;, features = [&quot;full&quot;] }</code></pre></div>
<p>Alternatively, you can only enable some features. For example, to enable
only the <a href="retry/index.html" title="mod tower::retry"><code>retry</code></a> and <a href="timeout/index.html" title="mod tower::timeout"><code>timeout</code></a> middleware, write:</p>
<div class="example-wrap"><pre class="language-toml"><code>tower = { version = &quot;0.4&quot;, features = [&quot;retry&quot;, &quot;timeout&quot;] }</code></pre></div>
<p>See <a href="#modules">here</a> for a complete list of all middleware provided by
Tower.</p>
<h3 id="supported-rust-versions"><a class="doc-anchor" href="#supported-rust-versions">§</a>Supported Rust Versions</h3>
<p>Tower will keep a rolling MSRV (minimum supported Rust version) policy of <strong>at
least</strong> 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.64.0.</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="builder/index.html" title="mod tower::builder">builder</a></dt><dd>Builder types to compose layers and services</dd><dt><a class="mod" href="layer/index.html" title="mod tower::layer">layer</a></dt><dd>A collection of <a href="trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> based tower services</dd><dt><a class="mod" href="make/index.html" title="mod tower::make">make</a></dt><dd>Trait aliases for Services that produce specific types of Responses.</dd><dt><a class="mod" href="retry/index.html" title="mod tower::retry">retry</a></dt><dd>Middleware for retrying “failed” requests.</dd><dt><a class="mod" href="timeout/index.html" title="mod tower::timeout">timeout</a></dt><dd>Middleware that applies a timeout to requests.</dd><dt><a class="mod" href="util/index.html" title="mod tower::util">util</a></dt><dd>Various utility types and functions that are generally used with Tower.</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.ServiceBuilder.html" title="struct tower::ServiceBuilder">Service<wbr>Builder</a></dt><dd>Declaratively construct <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</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.Layer.html" title="trait tower::Layer">Layer</a></dt><dd>Decorates a <a href="https://docs.rs/tower/*/tower/trait.Service.html"><code>Service</code></a>, transforming either the request or the response.</dd><dt><a class="trait" href="trait.MakeService.html" title="trait tower::MakeService">Make<wbr>Service</a></dt><dd>Creates new <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</dd><dt><a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a></dt><dd>An asynchronous function from a <code>Request</code> to a <code>Response</code>.</dd><dt><a class="trait" href="trait.ServiceExt.html" title="trait tower::ServiceExt">Service<wbr>Ext</a></dt><dd>An extension trait for <code>Service</code>s that provides a variety of convenient
adapters</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.service_fn.html" title="fn tower::service_fn">service_<wbr>fn</a></dt><dd>Returns a new <a href="util/struct.ServiceFn.html" title="struct tower::util::ServiceFn"><code>ServiceFn</code></a> with the given closure.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.BoxError.html" title="type tower::BoxError">BoxError</a></dt><dd>Alias for a type-erased error type.</dd></dl><script type="text/json" id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &amp;[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,50 @@
<!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="Returns a new `LayerFn` that implements `Layer` by calling the given function."><title>layer_fn in tower::layer - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">layer_fn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">layer_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>layer</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">tower</a>::<wbr><a href="index.html">layer</a></div><h1>Function <span class="fn">layer_<wbr>fn</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower_layer/layer_fn.rs.html#67">Source</a> </span></div><pre class="rust item-decl"><code>pub fn layer_fn&lt;T&gt;(f: T) -&gt; <a class="struct" href="struct.LayerFn.html" title="struct tower::layer::LayerFn">LayerFn</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="struct.LayerFn.html" title="struct tower::layer::LayerFn"><code>LayerFn</code></a> that implements <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> by calling the
given function.</p>
<p>The <a href="../trait.Layer.html#tymethod.layer" title="method tower::Layer::layer"><code>Layer::layer</code></a> method takes a type implementing <a href="https://docs.rs/tower-service/latest/tower_service/trait.Service.html"><code>Service</code></a> and
returns a different type implementing <a href="https://docs.rs/tower-service/latest/tower_service/trait.Service.html"><code>Service</code></a>. In many cases, this can
be implemented by a function or a closure. The <a href="struct.LayerFn.html" title="struct tower::layer::LayerFn"><code>LayerFn</code></a> helper allows
writing simple <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> implementations without needing the boilerplate of
a new struct implementing <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A middleware that logs requests before forwarding them to another service
</span><span class="kw">pub struct </span>LogService&lt;S&gt; {
target: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
service: S,
}
<span class="kw">impl</span>&lt;S, Request&gt; Service&lt;Request&gt; <span class="kw">for </span>LogService&lt;S&gt;
<span class="kw">where
</span>S: Service&lt;Request&gt;,
Request: fmt::Debug,
{
<span class="kw">type </span>Response = S::Response;
<span class="kw">type </span>Error = S::Error;
<span class="kw">type </span>Future = S::Future;
<span class="kw">fn </span>poll_ready(<span class="kw-2">&amp;mut </span><span class="self">self</span>, cx: <span class="kw-2">&amp;mut </span>Context&lt;<span class="lifetime">'_</span>&gt;) -&gt; Poll&lt;<span class="prelude-ty">Result</span>&lt;(), <span class="self">Self</span>::Error&gt;&gt; {
<span class="self">self</span>.service.poll_ready(cx)
}
<span class="kw">fn </span>call(<span class="kw-2">&amp;mut </span><span class="self">self</span>, request: Request) -&gt; <span class="self">Self</span>::Future {
<span class="comment">// Log the request
</span><span class="macro">println!</span>(<span class="string">"request = {:?}, target = {:?}"</span>, request, <span class="self">self</span>.target);
<span class="self">self</span>.service.call(request)
}
}
<span class="comment">// A `Layer` that wraps services in `LogService`
</span><span class="kw">let </span>log_layer = layer_fn(|service| {
LogService {
service,
target: <span class="string">"tower-docs"</span>,
}
});
<span class="comment">// An example service. This one uppercases strings
</span><span class="kw">let </span>uppercase_service = tower::service_fn(|request: String| <span class="kw">async move </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(request.to_uppercase())
});
<span class="comment">// Wrap our service in a `LogService` so requests are logged.
</span><span class="kw">let </span>wrapped_service = log_layer.layer(uppercase_service);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,3 @@
<!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 collection of `Layer` based tower services"><title>tower::layer - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module layer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module layer</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><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 class="in-crate"><a href="../index.html">In crate tower</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">tower</a></div><h1>Module <span>layer</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/layer.rs.html#1-14">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A collection of <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> based tower services</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="util/index.html" title="mod tower::layer::util">util</a></dt><dd>Utilities for combining layers</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.LayerFn.html" title="struct tower::layer::LayerFn">LayerFn</a></dt><dd>A <code>Layer</code> implemented by a closure. See the docs for <a href="fn.layer_fn.html" title="fn tower::layer::layer_fn"><code>layer_fn</code></a> for more details.</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.Layer.html" title="trait tower::layer::Layer">Layer</a></dt><dd>Decorates a <a href="https://docs.rs/tower/*/tower/trait.Service.html"><code>Service</code></a>, transforming either the request or the response.</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.layer_fn.html" title="fn tower::layer::layer_fn">layer_<wbr>fn</a></dt><dd>Returns a new <a href="struct.LayerFn.html" title="struct tower::layer::LayerFn"><code>LayerFn</code></a> that implements <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> by calling the
given function.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["layer_fn"],"mod":["util"],"struct":["LayerFn"],"trait":["Layer"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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="Utilities for combining layers"><title>tower::layer::util - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module util</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module util</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 tower::<wbr>layer</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">tower</a>::<wbr><a href="../index.html">layer</a></div><h1>Module <span>util</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/layer.rs.html#12">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities for combining layers</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.Identity.html" title="struct tower::layer::util::Identity">Identity</a></dt><dd>A no-op middleware.</dd><dt><a class="struct" href="struct.Stack.html" title="struct tower::layer::util::Stack">Stack</a></dt><dd>Two middlewares chained together.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Identity","Stack"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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="Future types"><title>tower::make::future - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module future</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module future</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 tower::<wbr>make</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">tower</a>::<wbr><a href="../index.html">make</a></div><h1>Module <span>future</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/make/mod.rs.html#10">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Future types</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.SharedFuture.html" title="struct tower::make::future::SharedFuture">Shared<wbr>Future</a></dt><dd>Response future from <a href="../struct.Shared.html" title="struct tower::make::Shared"><code>Shared</code></a> services.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["SharedFuture"]};

File diff suppressed because one or more lines are too long

View File

@@ -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="Trait aliases for Services that produce specific types of Responses."><title>tower::make - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module make</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module make</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><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tower</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">tower</a></div><h1>Module <span>make</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/make/mod.rs.html#1-14">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait aliases for Services that produce specific types of Responses.</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="future/index.html" title="mod tower::make::future">future</a></dt><dd>Future types</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.AsService.html" title="struct tower::make::AsService">AsService</a></dt><dd>Service returned by <a href="../trait.MakeService.html#method.as_service" title="method tower::MakeService::as_service"><code>MakeService::as_service</code></a>.</dd><dt><a class="struct" href="struct.IntoService.html" title="struct tower::make::IntoService">Into<wbr>Service</a></dt><dd>Service returned by <a href="../trait.MakeService.html#method.into_service" title="method tower::MakeService::into_service"><code>MakeService::into_service</code></a>.</dd><dt><a class="struct" href="struct.Shared.html" title="struct tower::make::Shared">Shared</a></dt><dd>A <a href="../trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> that produces services by cloning an inner service.</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.MakeConnection.html" title="trait tower::make::MakeConnection">Make<wbr>Connection</a></dt><dd>The <a href="trait.MakeConnection.html" title="trait tower::make::MakeConnection"><code>MakeConnection</code></a> trait is used to create transports.</dd><dt><a class="trait" href="trait.MakeService.html" title="trait tower::make::MakeService">Make<wbr>Service</a></dt><dd>Creates new <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/make/trait.MakeConnection.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/make/trait.MakeConnection.html">../../../tower/make/trait.MakeConnection.html</a>...</p>
<script>location.replace("../../../tower/make/trait.MakeConnection.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/make/struct.Shared.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/make/struct.Shared.html">../../../../tower/make/struct.Shared.html</a>...</p>
<script>location.replace("../../../../tower/make/struct.Shared.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/make/future/struct.SharedFuture.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/make/future/struct.SharedFuture.html">../../../../tower/make/future/struct.SharedFuture.html</a>...</p>
<script>location.replace("../../../../tower/make/future/struct.SharedFuture.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/make/struct.AsService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/make/struct.AsService.html">../../../tower/make/struct.AsService.html</a>...</p>
<script>location.replace("../../../tower/make/struct.AsService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/make/struct.IntoService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/make/struct.IntoService.html">../../../tower/make/struct.IntoService.html</a>...</p>
<script>location.replace("../../../tower/make/struct.IntoService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/trait.MakeService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/trait.MakeService.html">../../../tower/trait.MakeService.html</a>...</p>
<script>location.replace("../../../tower/trait.MakeService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["future"],"struct":["AsService","IntoService","Shared"],"trait":["MakeConnection","MakeService"]};

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

View File

@@ -0,0 +1,23 @@
<!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="The `MakeConnection` trait is used to create transports."><title>MakeConnection in tower::make - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">MakeConnection</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Connection</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Connection" title="Connection">Connection</a></li><li><a href="#associatedtype.Error" title="Error">Error</a></li><li><a href="#associatedtype.Future" title="Future">Future</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_connection" title="make_connection">make_connection</a></li><li><a href="#tymethod.poll_ready" title="poll_ready">poll_ready</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>make</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">tower</a>::<wbr><a href="index.html">make</a></div><h1>Trait <span class="trait">Make<wbr>Connection</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/make/make_connection.rs.html#12-27">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeConnection&lt;Target&gt;: Sealed&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(Target,)</a>&gt; {
type <a href="#associatedtype.Connection" class="associatedtype">Connection</a>: <a class="trait" href="../../tokio/io/async_read/trait.AsyncRead.html" title="trait tokio::io::async_read::AsyncRead">AsyncRead</a> + <a class="trait" href="../../tokio/io/async_write/trait.AsyncWrite.html" title="trait tokio::io::async_write::AsyncWrite">AsyncWrite</a>;
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Connection" title="type tower::make::MakeConnection::Connection">Connection</a>, Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Error" title="type tower::make::MakeConnection::Error">Error</a>&gt;&gt;;
// Required methods
fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Error" title="type tower::make::MakeConnection::Error">Error</a>&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.make_connection" class="fn">make_connection</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Future" title="type tower::make::MakeConnection::Future">Future</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <a href="trait.MakeConnection.html" title="trait tower::make::MakeConnection"><code>MakeConnection</code></a> trait is used to create transports.</p>
<p>The goal of this service is to allow composable methods for creating
<code>AsyncRead + AsyncWrite</code> transports. This could mean creating a TLS
based connection or using some other method to authenticate the connection.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Connection" class="method"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#14">Source</a><h4 class="code-header">type <a href="#associatedtype.Connection" class="associatedtype">Connection</a>: <a class="trait" href="../../tokio/io/async_read/trait.AsyncRead.html" title="trait tokio::io::async_read::AsyncRead">AsyncRead</a> + <a class="trait" href="../../tokio/io/async_write/trait.AsyncWrite.html" title="trait tokio::io::async_write::AsyncWrite">AsyncWrite</a></h4></section></summary><div class="docblock"><p>The transport provided by this service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="method"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#17">Source</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></section></summary><div class="docblock"><p>Errors produced by the connecting service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#20">Source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Connection" title="type tower::make::MakeConnection::Connection">Connection</a>, Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Error" title="type tower::make::MakeConnection::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>The future that eventually produces the transport</p>
</div></details></div><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.poll_ready" class="method"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#23">Source</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&amp;mut self, cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Error" title="type tower::make::MakeConnection::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns <code>Poll::Ready(Ok(()))</code> when it is able to make more connections.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.make_connection" class="method"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#26">Source</a><h4 class="code-header">fn <a href="#tymethod.make_connection" class="fn">make_connection</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="trait.MakeConnection.html#associatedtype.Future" title="type tower::make::MakeConnection::Future">Future</a></h4></section></summary><div class="docblock"><p>Connect and return a transport asynchronously</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MakeConnection%3CTarget%3E-for-C" class="impl"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#31-47">Source</a><a href="#impl-MakeConnection%3CTarget%3E-for-C" class="anchor">§</a><h3 class="code-header">impl&lt;C, Target&gt; <a class="trait" href="trait.MakeConnection.html" title="trait tower::make::MakeConnection">MakeConnection</a>&lt;Target&gt; for C<div class="where">where
C: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;,
C::<a class="associatedtype" href="../trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>: <a class="trait" href="../../tokio/io/async_read/trait.AsyncRead.html" title="trait tokio::io::async_read::AsyncRead">AsyncRead</a> + <a class="trait" href="../../tokio/io/async_write/trait.AsyncWrite.html" title="trait tokio::io::async_write::AsyncWrite">AsyncWrite</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Connection-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#36">Source</a><a href="#associatedtype.Connection-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Connection" class="associatedtype">Connection</a> = &lt;C as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#37">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;C as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_connection.rs.html#38">Source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = &lt;C as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></div></details></div><script src="../../trait.impl/tower/make/make_connection/trait.MakeConnection.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,89 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates new `Service` values."><title>MakeService in tower::make - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">MakeService</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Service</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Error" title="Error">Error</a></li><li><a href="#associatedtype.Future" title="Future">Future</a></li><li><a href="#associatedtype.MakeError" title="MakeError">MakeError</a></li><li><a href="#associatedtype.Response" title="Response">Response</a></li><li><a href="#associatedtype.Service" title="Service">Service</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_service" title="make_service">make_service</a></li><li><a href="#tymethod.poll_ready" title="poll_ready">poll_ready</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.as_service" title="as_service">as_service</a></li><li><a href="#method.into_service" title="into_service">into_service</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>make</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">tower</a>::<wbr><a href="index.html">make</a></div><h1>Trait <span class="trait">Make<wbr>Service</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/make/make_service.rs.html#21-130">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeService&lt;Target, Request&gt;: Sealed&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(Target, Request)</a>&gt; {
type <a href="#associatedtype.Response" class="associatedtype">Response</a>;
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
type <a href="#associatedtype.Service" class="associatedtype">Service</a>: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Request, Response = Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Response" title="type tower::MakeService::Response">Response</a>, Error = Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Error" title="type tower::MakeService::Error">Error</a>&gt;;
type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a>;
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Service" title="type tower::MakeService::Service">Service</a>, Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;;
// Required methods
fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.make_service" class="fn">make_service</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Future" title="type tower::MakeService::Future">Future</a>;
// Provided methods
fn <a href="#method.into_service" class="fn">into_service</a>(self) -&gt; <a class="struct" href="struct.IntoService.html" title="struct tower::make::IntoService">IntoService</a>&lt;Self, Request&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.as_service" class="fn">as_service</a>(&amp;mut self) -&gt; <a class="struct" href="struct.AsService.html" title="struct tower::make::AsService">AsService</a>&lt;'_, Self, Request&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates new <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</p>
<p>Acts as a service factory. This is useful for cases where new <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>
values must be produced. One case is a TCP server listener. The listener
accepts new TCP streams, obtains a new <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> value using the
<a href="../trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> trait, and uses that new <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> value to process inbound
requests on that new TCP stream.</p>
<p>This is essentially a trait alias for a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> of <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>s.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Response" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#23">Source</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a></h4></section></summary><div class="docblock"><p>Responses given by the service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#26">Source</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></section></summary><div class="docblock"><p>Errors produced by the service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Service" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#29">Source</a><h4 class="code-header">type <a href="#associatedtype.Service" class="associatedtype">Service</a>: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Request, Response = Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Response" title="type tower::MakeService::Response">Response</a>, Error = Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Error" title="type tower::MakeService::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>The <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> value created by this factory</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.MakeError" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#32">Source</a><h4 class="code-header">type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a></h4></section></summary><div class="docblock"><p>Errors produced while building a service.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#35">Source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Service" title="type tower::MakeService::Service">Service</a>, Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>The future of the <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> instance.</p>
</div></details></div><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.poll_ready" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#45">Source</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns <a href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html#variant.Ready" title="variant core::task::poll::Poll::Ready"><code>Poll::Ready</code></a> when the factory is able to create more services.</p>
<p>If the service is at capacity, then <a href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html#variant.Pending" title="variant core::task::poll::Poll::Pending"><code>Poll::Pending</code></a> is returned and the task
is notified when the service becomes ready again. This function is
expected to be called while on a task.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.make_service" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#48">Source</a><h4 class="code-header">fn <a href="#tymethod.make_service" class="fn">make_service</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="../trait.MakeService.html#associatedtype.Future" title="type tower::MakeService::Future">Future</a></h4></section></summary><div class="docblock"><p>Create and return a new service value asynchronously.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.into_service" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#79-87">Source</a><h4 class="code-header">fn <a href="#method.into_service" class="fn">into_service</a>(self) -&gt; <a class="struct" href="struct.IntoService.html" title="struct tower::make::IntoService">IntoService</a>&lt;Self, Request&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Consume this <a href="../trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> and convert it into a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::convert::Infallible;
<span class="kw">use </span>tower::Service;
<span class="kw">use </span>tower::make::MakeService;
<span class="kw">use </span>tower::service_fn;
<span class="comment">// A `MakeService`
</span><span class="kw">let </span>make_service = service_fn(|make_req: ()| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(service_fn(|req: String| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(req)
}))
});
<span class="comment">// Convert the `MakeService` into a `Service`
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = make_service.into_service();
<span class="comment">// Make a new service
</span><span class="kw">let </span><span class="kw-2">mut </span>new_svc = svc.call(()).<span class="kw">await</span>.unwrap();
<span class="comment">// Call the service
</span><span class="kw">let </span>res = new_svc.call(<span class="string">"foo"</span>.to_string()).<span class="kw">await</span>.unwrap();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_service" class="method"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#121-129">Source</a><h4 class="code-header">fn <a href="#method.as_service" class="fn">as_service</a>(&amp;mut self) -&gt; <a class="struct" href="struct.AsService.html" title="struct tower::make::AsService">AsService</a>&lt;'_, Self, Request&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert this <a href="../trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> into a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> without consuming the original <a href="../trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a>.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::convert::Infallible;
<span class="kw">use </span>tower::Service;
<span class="kw">use </span>tower::make::MakeService;
<span class="kw">use </span>tower::service_fn;
<span class="comment">// A `MakeService`
</span><span class="kw">let </span><span class="kw-2">mut </span>make_service = service_fn(|make_req: ()| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(service_fn(|req: String| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(req)
}))
});
<span class="comment">// Convert the `MakeService` into a `Service`
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = make_service.as_service();
<span class="comment">// Make a new service
</span><span class="kw">let </span><span class="kw-2">mut </span>new_svc = svc.call(()).<span class="kw">await</span>.unwrap();
<span class="comment">// Call the service
</span><span class="kw">let </span>res = new_svc.call(<span class="string">"foo"</span>.to_string()).<span class="kw">await</span>.unwrap();
<span class="comment">// The original `MakeService` is still accessible
</span><span class="kw">let </span>new_svc = make_service.make_service(()).<span class="kw">await</span>.unwrap();</code></pre></div></div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MakeService%3CTarget,+Request%3E-for-M" class="impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#139-157">Source</a><a href="#impl-MakeService%3CTarget,+Request%3E-for-M" class="anchor">§</a><h3 class="code-header">impl&lt;M, S, Target, Request&gt; <a class="trait" href="../trait.MakeService.html" title="trait tower::MakeService">MakeService</a>&lt;Target, Request&gt; for M<div class="where">where
M: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target, Response = S&gt;,
S: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#144">Source</a><a href="#associatedtype.Response-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = &lt;S as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#145">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;S as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Service-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#146">Source</a><a href="#associatedtype.Service-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Service" class="associatedtype">Service</a> = S</h4></section><section id="associatedtype.MakeError-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#147">Source</a><a href="#associatedtype.MakeError-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a> = &lt;M as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tower/make/make_service.rs.html#148">Source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = &lt;M as <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="../trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></div></details></div><script src="../../trait.impl/tower/make/make_service/trait.MakeService.js" async></script></section></div></main></body></html>

View File

@@ -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="This module contains generic backoff utilities to be used with the retry layer."><title>tower::retry::backoff - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module backoff</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module backoff</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tower::<wbr>retry</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">tower</a>::<wbr><a href="../index.html">retry</a></div><h1>Module <span>backoff</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/backoff.rs.html#1-279">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module contains generic <a href="https://en.wikipedia.org/wiki/Exponential_backoff">backoff</a> utilities to be used with the retry
layer.</p>
<p>The <a href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff"><code>Backoff</code></a> trait is a generic way to represent backoffs that can use
any timer type.</p>
<p><a href="struct.ExponentialBackoffMaker.html" title="struct tower::retry::backoff::ExponentialBackoffMaker"><code>ExponentialBackoffMaker</code></a> implements the maker type for<br />
<a href="struct.ExponentialBackoff.html" title="struct tower::retry::backoff::ExponentialBackoff"><code>ExponentialBackoff</code></a> which implements the <a href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff"><code>Backoff</code></a> trait and provides
a batteries included exponential backoff and jitter strategy.</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.ExponentialBackoff.html" title="struct tower::retry::backoff::ExponentialBackoff">Exponential<wbr>Backoff</a></dt><dd>A jittered <a href="https://en.wikipedia.org/wiki/Exponential_backoff">exponential backoff</a> strategy.</dd><dt><a class="struct" href="struct.ExponentialBackoffMaker.html" title="struct tower::retry::backoff::ExponentialBackoffMaker">Exponential<wbr>Backoff<wbr>Maker</a></dt><dd>A maker type for <a href="struct.ExponentialBackoff.html" title="struct tower::retry::backoff::ExponentialBackoff"><code>ExponentialBackoff</code></a>.</dd><dt><a class="struct" href="struct.InvalidBackoff.html" title="struct tower::retry::backoff::InvalidBackoff">Invalid<wbr>Backoff</a></dt><dd>Backoff validation error.</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.Backoff.html" title="trait tower::retry::backoff::Backoff">Backoff</a></dt><dd>A backoff trait where a single mutable reference represents a single
backoff session. Implementors must also implement <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> which will
reset the backoff back to the default state for the next session.</dd><dt><a class="trait" href="trait.MakeBackoff.html" title="trait tower::retry::backoff::MakeBackoff">Make<wbr>Backoff</a></dt><dd>Trait used to construct <a href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff"><code>Backoff</code></a> trait implementors.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["ExponentialBackoff","ExponentialBackoffMaker","InvalidBackoff"],"trait":["Backoff","MakeBackoff"]};

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

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A backoff trait where a single mutable reference represents a single backoff session. Implementors must also implement `Clone` which will reset the backoff back to the default state for the next session."><title>Backoff in tower::retry::backoff - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">Backoff</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Backoff</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Future" title="Future">Future</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.next_backoff" title="next_backoff">next_backoff</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>retry::<wbr>backoff</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">tower</a>::<wbr><a href="../index.html">retry</a>::<wbr><a href="index.html">backoff</a></div><h1>Trait <span class="trait">Backoff</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/backoff.rs.html#32-39">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Backoff {
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;;
// Required method
fn <a href="#tymethod.next_backoff" class="fn">next_backoff</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.Backoff.html#associatedtype.Future" title="type tower::retry::backoff::Backoff::Future">Future</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A backoff trait where a single mutable reference represents a single
backoff session. Implementors must also implement <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> which will
reset the backoff back to the default state for the next session.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#35">Source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>The future associated with each backoff. This usually will be some sort
of timer.</p>
</div></details></div><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.next_backoff" class="method"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#38">Source</a><h4 class="code-header">fn <a href="#tymethod.next_backoff" class="fn">next_backoff</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.Backoff.html#associatedtype.Future" title="type tower::retry::backoff::Backoff::Future">Future</a></h4></section></summary><div class="docblock"><p>Initiate the next backoff in the sequence.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Backoff-for-ExponentialBackoff%3CR%3E" class="impl"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#170-184">Source</a><a href="#impl-Backoff-for-ExponentialBackoff%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff">Backoff</a> for <a class="struct" href="struct.ExponentialBackoff.html" title="struct tower::retry::backoff::ExponentialBackoff">ExponentialBackoff</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="../../util/rng/trait.Rng.html" title="trait tower::util::rng::Rng">Rng</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#174">Source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="../../../tokio/time/sleep/struct.Sleep.html" title="struct tokio::time::sleep::Sleep">Sleep</a></h4></section></div></details></div><script src="../../../trait.impl/tower/retry/backoff/trait.Backoff.js" async></script></section></div></main></body></html>

View File

@@ -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="Trait used to construct `Backoff` trait implementors."><title>MakeBackoff in tower::retry::backoff - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">MakeBackoff</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Backoff</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Backoff" title="Backoff">Backoff</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_backoff" title="make_backoff">make_backoff</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>retry::<wbr>backoff</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">tower</a>::<wbr><a href="../index.html">retry</a>::<wbr><a href="index.html">backoff</a></div><h1>Trait <span class="trait">Make<wbr>Backoff</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/backoff.rs.html#21-27">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeBackoff {
type <a href="#associatedtype.Backoff" class="associatedtype">Backoff</a>: <a class="trait" href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff">Backoff</a>;
// Required method
fn <a href="#tymethod.make_backoff" class="fn">make_backoff</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.MakeBackoff.html#associatedtype.Backoff" title="type tower::retry::backoff::MakeBackoff::Backoff">Backoff</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait used to construct <a href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff"><code>Backoff</code></a> trait implementors.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Backoff" class="method"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#23">Source</a><h4 class="code-header">type <a href="#associatedtype.Backoff" class="associatedtype">Backoff</a>: <a class="trait" href="trait.Backoff.html" title="trait tower::retry::backoff::Backoff">Backoff</a></h4></section></summary><div class="docblock"><p>The backoff type produced by this maker.</p>
</div></details></div><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.make_backoff" class="method"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#26">Source</a><h4 class="code-header">fn <a href="#tymethod.make_backoff" class="fn">make_backoff</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.MakeBackoff.html#associatedtype.Backoff" title="type tower::retry::backoff::MakeBackoff::Backoff">Backoff</a></h4></section></summary><div class="docblock"><p>Constructs a new backoff type.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MakeBackoff-for-ExponentialBackoffMaker%3CR%3E" class="impl"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#117-132">Source</a><a href="#impl-MakeBackoff-for-ExponentialBackoffMaker%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="trait.MakeBackoff.html" title="trait tower::retry::backoff::MakeBackoff">MakeBackoff</a> for <a class="struct" href="struct.ExponentialBackoffMaker.html" title="struct tower::retry::backoff::ExponentialBackoffMaker">ExponentialBackoffMaker</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="../../util/rng/trait.Rng.html" title="trait tower::util::rng::Rng">Rng</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Backoff-1" class="associatedtype trait-impl"><a class="src rightside" href="../../../src/tower/retry/backoff.rs.html#121">Source</a><a href="#associatedtype.Backoff-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Backoff" class="associatedtype">Backoff</a> = <a class="struct" href="struct.ExponentialBackoff.html" title="struct tower::retry::backoff::ExponentialBackoff">ExponentialBackoff</a>&lt;R&gt;</h4></section></div></details></div><script src="../../../trait.impl/tower/retry/backoff/trait.MakeBackoff.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,61 @@
<!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 retry “budget” for allowing only a certain amount of retries over time."><title>tower::retry::budget - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module budget</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module budget</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#why-budgets-and-not-max-retries" title="Why budgets and not max retries?">Why budgets and not max retries?</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tower::<wbr>retry</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">tower</a>::<wbr><a href="../index.html">retry</a></div><h1>Module <span>budget</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/budget/mod.rs.html#1-90">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A retry “budget” for allowing only a certain amount of retries over time.</p>
<h2 id="why-budgets-and-not-max-retries"><a class="doc-anchor" href="#why-budgets-and-not-max-retries">§</a>Why budgets and not max retries?</h2>
<p>The most common way of configuring retries is to specify a maximum
number of retry attempts to perform before giving up. This is a familiar idea to anyone
whos used a web browser: you try to load a webpage, and if it doesnt load, you try again.
If it still doesnt load, you try a third time. Finally you give up.</p>
<p>Unfortunately, there are at least two problems with configuring retries this way:</p>
<p><strong>Choosing the maximum number of retry attempts is a guessing game.</strong>
You need to pick a number thats high enough to make a difference when things are somewhat failing,
but not so high that it generates extra load on the system when its really failing. In practice,
you usually pick a maximum retry attempts number out of a hat (e.g. 3) and hope for the best.</p>
<p><strong>Systems configured this way are vulnerable to retry storms.</strong>
A retry storm begins when one service starts to experience a larger than normal failure rate.
This causes its clients to retry those failed requests. The extra load from the retries causes the
service to slow down further and fail more requests, triggering more retries. If each client is
configured to retry up to 3 times, this can quadruple the number of requests being sent! To make
matters even worse, if any of the clients clients are configured with retries, the number of retries
compounds multiplicatively and can turn a small number of errors into a self-inflicted denial of service attack.</p>
<p>Its generally dangerous to implement retries without some limiting factor. <a href="trait.Budget.html" title="trait tower::retry::budget::Budget"><code>Budget</code></a>s are that limit.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::{future, sync::Arc};
<span class="kw">use </span>tower::retry::{budget::{Budget, TpsBudget}, Policy};
<span class="kw">type </span>Req = String;
<span class="kw">type </span>Res = String;
<span class="attr">#[derive(Clone, Debug)]
</span><span class="kw">struct </span>RetryPolicy {
budget: Arc&lt;TpsBudget&gt;,
}
<span class="kw">impl</span>&lt;E&gt; Policy&lt;Req, Res, E&gt; <span class="kw">for </span>RetryPolicy {
<span class="kw">type </span>Future = future::Ready&lt;()&gt;;
<span class="kw">fn </span>retry(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: <span class="kw-2">&amp;mut </span>Req, result: <span class="kw-2">&amp;mut </span><span class="prelude-ty">Result</span>&lt;Res, E&gt;) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Future&gt; {
<span class="kw">match </span>result {
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) =&gt; {
<span class="comment">// Treat all `Response`s as success,
// so deposit budget and don't retry...
</span><span class="self">self</span>.budget.deposit();
<span class="prelude-val">None
</span>}
<span class="prelude-val">Err</span>(<span class="kw">_</span>) =&gt; {
<span class="comment">// Treat all errors as failures...
// Withdraw the budget, don't retry if we overdrew.
</span><span class="kw">let </span>withdrew = <span class="self">self</span>.budget.withdraw();
<span class="kw">if </span>!withdrew {
<span class="kw">return </span><span class="prelude-val">None</span>;
}
<span class="comment">// Try again!
</span><span class="prelude-val">Some</span>(future::ready(()))
}
}
}
<span class="kw">fn </span>clone_request(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: <span class="kw-2">&amp;</span>Req) -&gt; <span class="prelude-ty">Option</span>&lt;Req&gt; {
<span class="prelude-val">Some</span>(req.clone())
}
}</code></pre></div></div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.TpsBudget"><code>pub use tps_budget::<a class="struct" href="tps_budget/struct.TpsBudget.html" title="struct tower::retry::budget::tps_budget::TpsBudget">TpsBudget</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="tps_budget/index.html" title="mod tower::retry::budget::tps_budget">tps_<wbr>budget</a></dt><dd>Transactions Per Minute (Tps) Budget implementations</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.Budget.html" title="trait tower::retry::budget::Budget">Budget</a></dt><dd>For more info about <a href="trait.Budget.html" title="trait tower::retry::budget::Budget"><code>Budget</code></a>, please see the <a href="index.html" title="mod tower::retry::budget">module-level documentation</a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["tps_budget"],"trait":["Budget"]};

View File

@@ -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="Transactions Per Minute (Tps) Budget implementations"><title>tower::retry::budget::tps_budget - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module tps_budget</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module tps_<wbr>budget</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 tower::<wbr>retry::<wbr>budget</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">tower</a>::<wbr><a href="../../index.html">retry</a>::<wbr><a href="../index.html">budget</a></div><h1>Module <span>tps_<wbr>budget</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/tower/retry/budget/tps_budget.rs.html#1-260">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Transactions Per Minute (Tps) Budget implementations</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.TpsBudget.html" title="struct tower::retry::budget::tps_budget::TpsBudget">TpsBudget</a></dt><dd>A Transactions Per Minute config for managing retry tokens.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["TpsBudget"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!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="For more info about `Budget`, please see the module-level documentation."><title>Budget in tower::retry::budget - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">Budget</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Budget</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.deposit" title="deposit">deposit</a></li><li><a href="#tymethod.withdraw" title="withdraw">withdraw</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>retry::<wbr>budget</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">tower</a>::<wbr><a href="../index.html">retry</a>::<wbr><a href="index.html">budget</a></div><h1>Trait <span class="trait">Budget</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/budget/mod.rs.html#80-90">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Budget {
// Required methods
fn <a href="#tymethod.deposit" class="fn">deposit</a>(&amp;self);
<span class="item-spacer"></span> fn <a href="#tymethod.withdraw" class="fn">withdraw</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>For more info about <a href="trait.Budget.html" title="trait tower::retry::budget::Budget"><code>Budget</code></a>, please see the <a href="index.html" title="mod tower::retry::budget">module-level documentation</a>.</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.deposit" class="method"><a class="src rightside" href="../../../src/tower/retry/budget/mod.rs.html#83">Source</a><h4 class="code-header">fn <a href="#tymethod.deposit" class="fn">deposit</a>(&amp;self)</h4></section></summary><div class="docblock"><p>Store a “deposit” in the budget, which will be used to permit future
withdrawals.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.withdraw" class="method"><a class="src rightside" href="../../../src/tower/retry/budget/mod.rs.html#89">Source</a><h4 class="code-header">fn <a href="#tymethod.withdraw" class="fn">withdraw</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Check whether there is enough “balance” in the budget to issue a new
retry.</p>
<p>If there is not enough, false is returned.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Budget-for-TpsBudget" class="impl"><a class="src rightside" href="../../../src/tower/retry/budget/tps_budget.rs.html#173-181">Source</a><a href="#impl-Budget-for-TpsBudget" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Budget.html" title="trait tower::retry::budget::Budget">Budget</a> for <a class="struct" href="tps_budget/struct.TpsBudget.html" title="struct tower::retry::budget::tps_budget::TpsBudget">TpsBudget</a></h3></section></div><script src="../../../trait.impl/tower/retry/budget/trait.Budget.js" async></script></section></div></main></body></html>

View File

@@ -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="Future types"><title>tower::retry::future - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module future</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module future</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 tower::<wbr>retry</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">tower</a>::<wbr><a href="../index.html">retry</a></div><h1>Module <span>future</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/retry/future.rs.html#1-119">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Future types</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.ResponseFuture.html" title="struct tower::retry::future::ResponseFuture">Response<wbr>Future</a></dt><dd>The <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a> returned by a <a href="../struct.Retry.html" title="struct tower::retry::Retry"><code>Retry</code></a> service.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["ResponseFuture"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
<!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="Middleware for retrying “failed” requests."><title>tower::retry - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module retry</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module retry</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><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tower</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">tower</a></div><h1>Module <span>retry</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/retry/mod.rs.html#1-94">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Middleware for retrying “failed” requests.</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="backoff/index.html" title="mod tower::retry::backoff">backoff</a></dt><dd>This module contains generic <a href="https://en.wikipedia.org/wiki/Exponential_backoff">backoff</a> utilities to be used with the retry
layer.</dd><dt><a class="mod" href="budget/index.html" title="mod tower::retry::budget">budget</a></dt><dd>A retry “budget” for allowing only a certain amount of retries over time.</dd><dt><a class="mod" href="future/index.html" title="mod tower::retry::future">future</a></dt><dd>Future types</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.Retry.html" title="struct tower::retry::Retry">Retry</a></dt><dd>Configure retrying requests of “failed” responses.</dd><dt><a class="struct" href="struct.RetryLayer.html" title="struct tower::retry::RetryLayer">Retry<wbr>Layer</a></dt><dd>Retry requests based on a policy</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.Policy.html" title="trait tower::retry::Policy">Policy</a></dt><dd>A “retry policy” to classify if a request should be retried.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/retry/struct.RetryLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/retry/struct.RetryLayer.html">../../../tower/retry/struct.RetryLayer.html</a>...</p>
<script>location.replace("../../../tower/retry/struct.RetryLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/retry/trait.Policy.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/retry/trait.Policy.html">../../../tower/retry/trait.Policy.html</a>...</p>
<script>location.replace("../../../tower/retry/trait.Policy.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["backoff","budget","future"],"struct":["Retry","RetryLayer"],"trait":["Policy"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,79 @@
<!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 “retry policy” to classify if a request should be retried."><title>Policy in tower::retry - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">Policy</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Policy</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="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Future" title="Future">Future</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.clone_request" title="clone_request">clone_request</a></li><li><a href="#tymethod.retry" title="retry">retry</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<wbr>retry</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">tower</a>::<wbr><a href="index.html">retry</a></div><h1>Trait <span class="trait">Policy</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/retry/policy.rs.html#46-90">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Policy&lt;Req, Res, E&gt; {
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;;
// Required methods
fn <a href="#tymethod.retry" class="fn">retry</a>(
&amp;mut self,
req: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut Req</a>,
result: &amp;mut <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Res, E&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Policy.html#associatedtype.Future" title="type tower::retry::Policy::Future">Future</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.clone_request" class="fn">clone_request</a>(&amp;mut self, req: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;Req</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Req&gt;;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A “retry policy” to classify if a request should be retried.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::retry::Policy;
<span class="kw">use </span>std::future;
<span class="kw">type </span>Req = String;
<span class="kw">type </span>Res = String;
<span class="kw">struct </span>Attempts(usize);
<span class="kw">impl</span>&lt;E&gt; Policy&lt;Req, Res, E&gt; <span class="kw">for </span>Attempts {
<span class="kw">type </span>Future = future::Ready&lt;()&gt;;
<span class="kw">fn </span>retry(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: <span class="kw-2">&amp;mut </span>Req, result: <span class="kw-2">&amp;mut </span><span class="prelude-ty">Result</span>&lt;Res, E&gt;) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Future&gt; {
<span class="kw">match </span>result {
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) =&gt; {
<span class="comment">// Treat all `Response`s as success,
// so don't retry...
</span><span class="prelude-val">None
</span>},
<span class="prelude-val">Err</span>(<span class="kw">_</span>) =&gt; {
<span class="comment">// Treat all errors as failures...
// But we limit the number of attempts...
</span><span class="kw">if </span><span class="self">self</span>.<span class="number">0 </span>&gt; <span class="number">0 </span>{
<span class="comment">// Try again!
</span><span class="self">self</span>.<span class="number">0 </span>-= <span class="number">1</span>;
<span class="prelude-val">Some</span>(future::ready(()))
} <span class="kw">else </span>{
<span class="comment">// Used all our attempts, no retry...
</span><span class="prelude-val">None
</span>}
}
}
}
<span class="kw">fn </span>clone_request(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: <span class="kw-2">&amp;</span>Req) -&gt; <span class="prelude-ty">Option</span>&lt;Req&gt; {
<span class="prelude-val">Some</span>(req.clone())
}
}</code></pre></div></div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../../src/tower/retry/policy.rs.html#48">Source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>&gt;</h4></section></summary><div class="docblock"><p>The <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a> type returned by <a href="trait.Policy.html#tymethod.retry" title="method tower::retry::Policy::retry"><code>Policy::retry</code></a>.</p>
</div></details></div><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.retry" class="method"><a class="src rightside" href="../../src/tower/retry/policy.rs.html#83">Source</a><h4 class="code-header">fn <a href="#tymethod.retry" class="fn">retry</a>(
&amp;mut self,
req: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut Req</a>,
result: &amp;mut <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Res, E&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Policy.html#associatedtype.Future" title="type tower::retry::Policy::Future">Future</a>&gt;</h4></section></summary><div class="docblock"><p>Check the policy if a certain request should be retried.</p>
<p>This method is passed a reference to the original request, and either
the <a href="../trait.Service.html#associatedtype.Response" title="associated type tower::Service::Response"><code>Service::Response</code></a> or <a href="../trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Service::Error</code></a> from the inner service.</p>
<p>If the request should <strong>not</strong> be retried, return <code>None</code>.</p>
<p>If the request <em>should</em> be retried, return <code>Some</code> future that will delay
the next retry of the request. This can be used to sleep for a certain
duration, to wait for some external condition to be met before retrying,
or resolve right away, if the request should be retried immediately.</p>
<h6 id="mutating-requests"><a class="doc-anchor" href="#mutating-requests">§</a>Mutating Requests</h6>
<p>The policy MAY chose to mutate the <code>req</code>: if the request is mutated, the
mutated request will be sent to the inner service in the next retry.
This can be helpful for use cases like tracking the retry count in a
header.</p>
<h6 id="mutating-results"><a class="doc-anchor" href="#mutating-results">§</a>Mutating Results</h6>
<p>The policy MAY chose to mutate the result. This enables the retry
policy to convert a failure into a success and vice versa. For example,
if the policy is used to poll while waiting for a state change, the
policy can switch the result to emit a specific error when retries are
exhausted.</p>
<p>The policy can also record metadata on the request to include
information about the number of retries required or to record that a
failure failed after exhausting all retries.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.clone_request" class="method"><a class="src rightside" href="../../src/tower/retry/policy.rs.html#89">Source</a><h4 class="code-header">fn <a href="#tymethod.clone_request" class="fn">clone_request</a>(&amp;mut self, req: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;Req</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Req&gt;</h4></section></summary><div class="docblock"><p>Tries to clone a request before being passed to the inner service.</p>
<p>If the request cannot be cloned, return <a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html#variant.None" title="variant core::option::Option::None"><code>None</code></a>. Moreover, the retry
function will not be called if the <a href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html#variant.None" title="variant core::option::Option::None"><code>None</code></a> is returned.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/tower/retry/policy/trait.Policy.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["service_fn"],"mod":["builder","layer","make","retry","timeout","util"],"struct":["ServiceBuilder"],"trait":["Layer","MakeService","Service","ServiceExt"],"type":["BoxError"]};

File diff suppressed because one or more lines are too long

View File

@@ -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="Error types"><title>tower::timeout::error - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module error</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</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 tower::<wbr>timeout</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">tower</a>::<wbr><a href="../index.html">timeout</a></div><h1>Module <span>error</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/timeout/error.rs.html#1-22">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Error types</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.Elapsed.html" title="struct tower::timeout::error::Elapsed">Elapsed</a></dt><dd>The timeout elapsed.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Elapsed"]};

File diff suppressed because one or more lines are too long

View File

@@ -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="Future types"><title>tower::timeout::future - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module future</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module future</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 tower::<wbr>timeout</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">tower</a>::<wbr><a href="../index.html">timeout</a></div><h1>Module <span>future</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/timeout/future.rs.html#1-53">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Future types</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.ResponseFuture.html" title="struct tower::timeout::future::ResponseFuture">Response<wbr>Future</a></dt><dd><a href="../struct.Timeout.html" title="struct tower::timeout::Timeout"><code>Timeout</code></a> response future</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["ResponseFuture"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<!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="Middleware that applies a timeout to requests."><title>tower::timeout - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module timeout</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module timeout</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 class="in-crate"><a href="../index.html">In crate tower</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">tower</a></div><h1>Module <span>timeout</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/timeout/mod.rs.html#1-70">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Middleware that applies a timeout to requests.</p>
<p>If the response does not complete within the specified timeout, the response
will be aborted.</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="error/index.html" title="mod tower::timeout::error">error</a></dt><dd>Error types</dd><dt><a class="mod" href="future/index.html" title="mod tower::timeout::future">future</a></dt><dd>Future types</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.Timeout.html" title="struct tower::timeout::Timeout">Timeout</a></dt><dd>Applies a timeout to requests.</dd><dt><a class="struct" href="struct.TimeoutLayer.html" title="struct tower::timeout::TimeoutLayer">Timeout<wbr>Layer</a></dt><dd>Applies a timeout to requests via the supplied inner service.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/timeout/struct.TimeoutLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/timeout/struct.TimeoutLayer.html">../../../tower/timeout/struct.TimeoutLayer.html</a>...</p>
<script>location.replace("../../../tower/timeout/struct.TimeoutLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["error","future"],"struct":["Timeout","TimeoutLayer"]};

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

View File

@@ -0,0 +1,89 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Creates new `Service` values."><title>MakeService in tower - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">MakeService</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Service</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Error" title="Error">Error</a></li><li><a href="#associatedtype.Future" title="Future">Future</a></li><li><a href="#associatedtype.MakeError" title="MakeError">MakeError</a></li><li><a href="#associatedtype.Response" title="Response">Response</a></li><li><a href="#associatedtype.Service" title="Service">Service</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_service" title="make_service">make_service</a></li><li><a href="#tymethod.poll_ready" title="poll_ready">poll_ready</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.as_service" title="as_service">as_service</a></li><li><a href="#method.into_service" title="into_service">into_service</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tower</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">tower</a></div><h1>Trait <span class="trait">Make<wbr>Service</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tower/make/make_service.rs.html#21-130">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeService&lt;Target, Request&gt;: Sealed&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.tuple.html">(Target, Request)</a>&gt; {
type <a href="#associatedtype.Response" class="associatedtype">Response</a>;
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
type <a href="#associatedtype.Service" class="associatedtype">Service</a>: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request, Response = Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Response" title="type tower::MakeService::Response">Response</a>, Error = Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Error" title="type tower::MakeService::Error">Error</a>&gt;;
type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a>;
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Service" title="type tower::MakeService::Service">Service</a>, Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;;
// Required methods
fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.make_service" class="fn">make_service</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Future" title="type tower::MakeService::Future">Future</a>;
// Provided methods
fn <a href="#method.into_service" class="fn">into_service</a>(self) -&gt; <a class="struct" href="make/struct.IntoService.html" title="struct tower::make::IntoService">IntoService</a>&lt;Self, Request&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.as_service" class="fn">as_service</a>(&amp;mut self) -&gt; <a class="struct" href="make/struct.AsService.html" title="struct tower::make::AsService">AsService</a>&lt;'_, Self, Request&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates new <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> values.</p>
<p>Acts as a service factory. This is useful for cases where new <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>
values must be produced. One case is a TCP server listener. The listener
accepts new TCP streams, obtains a new <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> value using the
<a href="trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> trait, and uses that new <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> value to process inbound
requests on that new TCP stream.</p>
<p>This is essentially a trait alias for a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> of <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>s.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Response" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#23">Source</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a></h4></section></summary><div class="docblock"><p>Responses given by the service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#26">Source</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></section></summary><div class="docblock"><p>Errors produced by the service</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Service" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#29">Source</a><h4 class="code-header">type <a href="#associatedtype.Service" class="associatedtype">Service</a>: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request, Response = Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Response" title="type tower::MakeService::Response">Response</a>, Error = Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Error" title="type tower::MakeService::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>The <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> value created by this factory</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.MakeError" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#32">Source</a><h4 class="code-header">type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a></h4></section></summary><div class="docblock"><p>Errors produced while building a service.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#35">Source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Service" title="type tower::MakeService::Service">Service</a>, Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>The future of the <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> instance.</p>
</div></details></div><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.poll_ready" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#45">Source</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(
&amp;mut self,
cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.MakeError" title="type tower::MakeService::MakeError">MakeError</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns <a href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html#variant.Ready" title="variant core::task::poll::Poll::Ready"><code>Poll::Ready</code></a> when the factory is able to create more services.</p>
<p>If the service is at capacity, then <a href="https://doc.rust-lang.org/1.93.1/core/task/poll/enum.Poll.html#variant.Pending" title="variant core::task::poll::Poll::Pending"><code>Poll::Pending</code></a> is returned and the task
is notified when the service becomes ready again. This function is
expected to be called while on a task.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.make_service" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#48">Source</a><h4 class="code-header">fn <a href="#tymethod.make_service" class="fn">make_service</a>(&amp;mut self, target: Target) -&gt; Self::<a class="associatedtype" href="trait.MakeService.html#associatedtype.Future" title="type tower::MakeService::Future">Future</a></h4></section></summary><div class="docblock"><p>Create and return a new service value asynchronously.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.into_service" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#79-87">Source</a><h4 class="code-header">fn <a href="#method.into_service" class="fn">into_service</a>(self) -&gt; <a class="struct" href="make/struct.IntoService.html" title="struct tower::make::IntoService">IntoService</a>&lt;Self, Request&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Consume this <a href="trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> and convert it into a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::convert::Infallible;
<span class="kw">use </span>tower::Service;
<span class="kw">use </span>tower::make::MakeService;
<span class="kw">use </span>tower::service_fn;
<span class="comment">// A `MakeService`
</span><span class="kw">let </span>make_service = service_fn(|make_req: ()| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(service_fn(|req: String| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(req)
}))
});
<span class="comment">// Convert the `MakeService` into a `Service`
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = make_service.into_service();
<span class="comment">// Make a new service
</span><span class="kw">let </span><span class="kw-2">mut </span>new_svc = svc.call(()).<span class="kw">await</span>.unwrap();
<span class="comment">// Call the service
</span><span class="kw">let </span>res = new_svc.call(<span class="string">"foo"</span>.to_string()).<span class="kw">await</span>.unwrap();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.as_service" class="method"><a class="src rightside" href="../src/tower/make/make_service.rs.html#121-129">Source</a><h4 class="code-header">fn <a href="#method.as_service" class="fn">as_service</a>(&amp;mut self) -&gt; <a class="struct" href="make/struct.AsService.html" title="struct tower::make::AsService">AsService</a>&lt;'_, Self, Request&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert this <a href="trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a> into a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> without consuming the original <a href="trait.MakeService.html" title="trait tower::MakeService"><code>MakeService</code></a>.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::convert::Infallible;
<span class="kw">use </span>tower::Service;
<span class="kw">use </span>tower::make::MakeService;
<span class="kw">use </span>tower::service_fn;
<span class="comment">// A `MakeService`
</span><span class="kw">let </span><span class="kw-2">mut </span>make_service = service_fn(|make_req: ()| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(service_fn(|req: String| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(req)
}))
});
<span class="comment">// Convert the `MakeService` into a `Service`
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = make_service.as_service();
<span class="comment">// Make a new service
</span><span class="kw">let </span><span class="kw-2">mut </span>new_svc = svc.call(()).<span class="kw">await</span>.unwrap();
<span class="comment">// Call the service
</span><span class="kw">let </span>res = new_svc.call(<span class="string">"foo"</span>.to_string()).<span class="kw">await</span>.unwrap();
<span class="comment">// The original `MakeService` is still accessible
</span><span class="kw">let </span>new_svc = make_service.make_service(()).<span class="kw">await</span>.unwrap();</code></pre></div></div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MakeService%3CTarget,+Request%3E-for-M" class="impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#139-157">Source</a><a href="#impl-MakeService%3CTarget,+Request%3E-for-M" class="anchor">§</a><h3 class="code-header">impl&lt;M, S, Target, Request&gt; <a class="trait" href="trait.MakeService.html" title="trait tower::MakeService">MakeService</a>&lt;Target, Request&gt; for M<div class="where">where
M: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Target, Response = S&gt;,
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#144">Source</a><a href="#associatedtype.Response-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = &lt;S as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#145">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;S as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Service-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#146">Source</a><a href="#associatedtype.Service-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Service" class="associatedtype">Service</a> = S</h4></section><section id="associatedtype.MakeError-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#147">Source</a><a href="#associatedtype.MakeError-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.MakeError" class="associatedtype">MakeError</a> = &lt;M as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#148">Source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = &lt;M as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></div></details></div><script src="../trait.impl/tower/make/make_service/trait.MakeService.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,362 @@
<!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="An extension trait for `Service`s that provides a variety of convenient adapters"><title>ServiceExt in tower - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc 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="#">ServiceExt</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Service<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.and_then" title="and_then">and_then</a></li><li><a href="#method.boxed" title="boxed">boxed</a></li><li><a href="#method.boxed_clone" title="boxed_clone">boxed_clone</a></li><li><a href="#method.call_all" title="call_all">call_all</a></li><li><a href="#method.map_err" title="map_err">map_err</a></li><li><a href="#method.map_future" title="map_future">map_future</a></li><li><a href="#method.map_request" title="map_request">map_request</a></li><li><a href="#method.map_response" title="map_response">map_response</a></li><li><a href="#method.map_result" title="map_result">map_result</a></li><li><a href="#method.oneshot" title="oneshot">oneshot</a></li><li><a href="#method.ready" title="ready">ready</a></li><li><a href="#method.ready_oneshot" title="ready_oneshot">ready_oneshot</a></li><li><a href="#method.then" title="then">then</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tower</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">tower</a></div><h1>Trait <span class="trait">Service<wbr>Ext</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tower/util/mod.rs.html#71-1043">Source</a> </span></div><pre class="rust item-decl"><code>pub trait ServiceExt&lt;Request&gt;: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 13 methods</span></summary> // Provided methods
fn <a href="#method.ready" class="fn">ready</a>(&amp;mut self) -&gt; <a class="struct" href="util/struct.Ready.html" title="struct tower::util::Ready">Ready</a>&lt;'_, Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="Ready&lt;&#39;_, Self, Request&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.ready_oneshot" class="fn">ready_oneshot</a>(self) -&gt; <a class="struct" href="util/struct.ReadyOneshot.html" title="struct tower::util::ReadyOneshot">ReadyOneshot</a>&lt;Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="ReadyOneshot&lt;Self, Request&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.oneshot" class="fn">oneshot</a>(self, req: Request) -&gt; <a class="struct" href="util/struct.Oneshot.html" title="struct tower::util::Oneshot">Oneshot</a>&lt;Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="Oneshot&lt;Self, Request&gt;"></a>
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.call_all" class="fn">call_all</a>&lt;S&gt;(self, reqs: S) -&gt; <a class="struct" href="util/struct.CallAll.html" title="struct tower::util::CallAll">CallAll</a>&lt;Self, S&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
S: <a class="trait" href="../futures_core/stream/trait.Stream.html" title="trait futures_core::stream::Stream">Stream</a>&lt;Item = Request&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.and_then" class="fn">and_then</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.AndThen.html" title="struct tower::util::AndThen">AndThen</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_response" class="fn">map_response</a>&lt;F, Response&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapResponse.html" title="struct tower::util::MapResponse">MapResponse</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>) -&gt; Response + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_err" class="fn">map_err</a>&lt;F, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapErr.html" title="struct tower::util::MapErr">MapErr</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>) -&gt; Error + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_result" class="fn">map_result</a>&lt;F, Response, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapResult.html" title="struct tower::util::MapResult">MapResult</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_request" class="fn">map_request</a>&lt;F, NewRequest&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapRequest.html" title="struct tower::util::MapRequest">MapRequest</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(NewRequest) -&gt; Request</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.then" class="fn">then</a>&lt;F, Response, Error, Fut&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.Then.html" title="struct tower::util::Then">Then</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;) -&gt; Fut + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt;&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_future" class="fn">map_future</a>&lt;F, Fut, Response, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapFuture.html" title="struct tower::util::MapFuture">MapFuture</a>&lt;Self, F&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>) -&gt; Fut,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt;&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="util/struct.BoxService.html" title="struct tower::util::BoxService">BoxService</a>&lt;Request, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.boxed_clone" class="fn">boxed_clone</a>(
self,
) -&gt; <a class="struct" href="util/struct.BoxCloneService.html" title="struct tower::util::BoxCloneService">BoxCloneService</a>&lt;Request, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static</span> { ... }
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait for <code>Service</code>s that provides a variety of convenient
adapters</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.ready" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#73-78">Source</a><h4 class="code-header">fn <a href="#method.ready" class="fn">ready</a>(&amp;mut self) -&gt; <a class="struct" href="util/struct.Ready.html" title="struct tower::util::Ready">Ready</a>&lt;'_, Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="Ready&lt;&#39;_, Self, Request&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Yields a mutable reference to the service when it is ready to accept a request.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.ready_oneshot" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#81-86">Source</a><h4 class="code-header">fn <a href="#method.ready_oneshot" class="fn">ready_oneshot</a>(self) -&gt; <a class="struct" href="util/struct.ReadyOneshot.html" title="struct tower::util::ReadyOneshot">ReadyOneshot</a>&lt;Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="ReadyOneshot&lt;Self, Request&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Yields the service when it is ready to accept a request.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.oneshot" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#89-94">Source</a><h4 class="code-header">fn <a href="#method.oneshot" class="fn">oneshot</a>(self, req: Request) -&gt; <a class="struct" href="util/struct.Oneshot.html" title="struct tower::util::Oneshot">Oneshot</a>&lt;Self, Request&gt; <a href="#" class="tooltip" data-notable-ty="Oneshot&lt;Self, Request&gt;"></a><div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Consume this <code>Service</code>, calling it with the provided request once it is ready.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.call_all" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#104-110">Source</a><h4 class="code-header">fn <a href="#method.call_all" class="fn">call_all</a>&lt;S&gt;(self, reqs: S) -&gt; <a class="struct" href="util/struct.CallAll.html" title="struct tower::util::CallAll">CallAll</a>&lt;Self, S&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
S: <a class="trait" href="../futures_core/stream/trait.Stream.html" title="trait futures_core::stream::Stream">Stream</a>&lt;Item = Request&gt;,</div></h4></section></summary><div class="docblock"><p>Process all requests from the given <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream</code></a>, and produce a <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream</code></a> of their responses.</p>
<p>This is essentially <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream&lt;Item = Request&gt;</code></a> + <code>Self</code> =&gt; <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream&lt;Item = Response&gt;</code></a>. See the documentation for <a href="util/struct.CallAll.html" title="struct tower::util::CallAll"><code>CallAll</code></a> for
details.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.and_then" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#172-178">Source</a><h4 class="code-header">fn <a href="#method.and_then" class="fn">and_then</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.AndThen.html" title="struct tower::util::AndThen">AndThen</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Executes a new future after this services future resolves. This does
not alter the behaviour of the <a href="trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>poll_ready</code></a> method.</p>
<p>This method can be used to change the <a href="trait.Service.html#associatedtype.Response" title="associated type tower::Service::Response"><code>Response</code></a> type of the service
into a different type. You can use this method to chain along a computation once the
services response has been resolved.</p>
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;Record, _&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// Map the response into a new response
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.and_then(|record: Record| <span class="kw">async move </span>{
<span class="kw">let </span>name = record.name;
avatar_lookup(name).<span class="kw">await
</span>});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>avatar = new_service.call(id).<span class="kw">await</span>.unwrap();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.map_response" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#241-247">Source</a><h4 class="code-header">fn <a href="#method.map_response" class="fn">map_response</a>&lt;F, Response&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapResponse.html" title="struct tower::util::MapResponse">MapResponse</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>) -&gt; Response + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Maps this services response value to a different value. This does not
alter the behaviour of the <a href="trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>poll_ready</code></a> method.</p>
<p>This method can be used to change the <a href="trait.Service.html#associatedtype.Response" title="associated type tower::Service::Response"><code>Response</code></a> type of the service
into a different type. It is similar to the <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#method.map" title="method core::result::Result::map"><code>Result::map</code></a>
method. You can use this method to chain along a computation once the
services response has been resolved.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;Record, _&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// Map the response into a new response
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_response(|record| record.name);
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>name = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.map_err" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#309-315">Source</a><h4 class="code-header">fn <a href="#method.map_err" class="fn">map_err</a>&lt;F, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapErr.html" title="struct tower::util::MapErr">MapErr</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>) -&gt; Error + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Maps this services error value to a different value. This does not
alter the behaviour of the <a href="trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>poll_ready</code></a> method.</p>
<p>This method can be used to change the <a href="trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Error</code></a> type of the service
into a different type. It is similar to the <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#method.map_err" title="method core::result::Result::map_err"><code>Result::map_err</code></a> method.</p>
<h5 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;_, Error&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// Map the error to a new error
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_err(|err| err.code);
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>code = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await
</span>.unwrap_err();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.map_result" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#538-545">Source</a><h4 class="code-header">fn <a href="#method.map_result" class="fn">map_result</a>&lt;F, Response, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapResult.html" title="struct tower::util::MapResult">MapResult</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Maps this services result type (<code>Result&lt;Self::Response, Self::Error&gt;</code>)
to a different value, regardless of whether the future succeeds or
fails.</p>
<p>This is similar to the <a href="trait.ServiceExt.html#method.map_response" title="method tower::ServiceExt::map_response"><code>map_response</code></a> and <a href="trait.ServiceExt.html#method.map_err" title="method tower::ServiceExt::map_err"><code>map_err</code></a> combinators,
except that the <em>same</em> function is invoked when the services future
completes, whether it completes successfully or fails. This function
takes the <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a> returned by the services future, and returns a
<a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a>.</p>
<p>Like the standard librarys <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#method.and_then" title="method core::result::Result::and_then"><code>Result::and_then</code></a>, this method can be
used to implement control flow based on <code>Result</code> values. For example, it
may be used to implement error recovery, by turning some <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a>
responses from the service into <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a> responses. Similarly, some
successful responses from the service could be rejected, by returning an
<a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#variant.Err" title="variant core::result::Result::Err"><code>Err</code></a> conditionally, depending on the value inside the <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html#variant.Ok" title="variant core::result::Result::Ok"><code>Ok</code></a>. Finally,
this method can also be used to implement behaviors that must run when a
services future completes, regardless of whether it succeeded or failed.</p>
<p>This method can be used to change the <a href="trait.Service.html#associatedtype.Response" title="associated type tower::Service::Response"><code>Response</code></a> type of the service
into a different type. It can also be used to change the <a href="trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Error</code></a> type
of the service. However, because the <a href="trait.ServiceExt.html#method.map_result" title="method tower::ServiceExt::map_result"><code>map_result</code></a> function is not applied
to the errors returned by the services <a href="trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>poll_ready</code></a> method, it must
be possible to convert the services <a href="trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Error</code></a> type into the error type
returned by the <a href="trait.ServiceExt.html#method.map_result" title="method tower::ServiceExt::map_result"><code>map_result</code></a> function. This is trivial when the function
returns the same error type as the service, but in other cases, it can
be useful to use <a href="type.BoxError.html" title="type tower::BoxError"><code>BoxError</code></a> to erase differing error types.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<p>Recovering from certain errors:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;Vec&lt;Record&gt;, DbError&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// If the database returns no records for the query, we just want an empty `Vec`.
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_result(|result| <span class="kw">match </span>result {
<span class="comment">// If the error indicates that no records matched the query, return an empty
// `Vec` instead.
</span><span class="prelude-val">Err</span>(DbError::NoRecordsFound) =&gt; <span class="prelude-val">Ok</span>(Vec::new()),
<span class="comment">// Propagate all other responses (`Ok` and `Err`) unchanged
</span>x =&gt; x,
});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>name = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<p>Rejecting some <code>Ok</code> responses:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::BoxError;
<span class="comment">// A service returning Result&lt;Record, DbError&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// If the user is zero years old, return an error.
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_result(|result| {
<span class="kw">let </span>record = result<span class="question-mark">?</span>;
<span class="kw">if </span>record.age == <span class="number">0 </span>{
<span class="comment">// Users must have been born to use our app!
</span><span class="kw">let </span>app_error = AppError::from(<span class="string">"users cannot be 0 years old!"</span>);
<span class="comment">// Box the error to erase its type (as it can be an `AppError`
// *or* the inner service's `DbError`).
</span><span class="kw">return </span><span class="prelude-val">Err</span>(BoxError::from(app_error));
}
<span class="comment">// Otherwise, return the record.
</span><span class="prelude-val">Ok</span>(record)
});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>record = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<p>Performing an action that must be run for both successes and failures:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;Record, DbError&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// Print a message whenever a query completes.
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_result(|result| {
<span class="macro">println!</span>(<span class="string">"query completed; success={}"</span>, result.is_ok());
result
});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>response = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span>;</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.map_request" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#598-604">Source</a><h4 class="code-header">fn <a href="#method.map_request" class="fn">map_request</a>&lt;F, NewRequest&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapRequest.html" title="struct tower::util::MapRequest">MapRequest</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(NewRequest) -&gt; Request,</div></h4></section></summary><div class="docblock"><p>Composes a function <em>in front of</em> the service.</p>
<p>This adapter produces a new service that passes each value through the
given function <code>f</code> before sending it to <code>self</code>.</p>
<h5 id="example-3"><a class="doc-anchor" href="#example-3">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service taking a String as a request
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// Map the request to a new request
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_request(|id: u32| id.to_string());
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>response = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span>;</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.then" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#863-871">Source</a><h4 class="code-header">fn <a href="#method.then" class="fn">then</a>&lt;F, Response, Error, Fut&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.Then.html" title="struct tower::util::Then">Then</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;) -&gt; Fut + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt;&gt;,</div></h4></section></summary><div class="docblock"><p>Composes an asynchronous function <em>after</em> this service.</p>
<p>This takes a function or closure returning a future, and returns a new
<code>Service</code> that chains that function after this services <a href="trait.Service.html#associatedtype.Future" title="associated type tower::Service::Future"><code>Future</code></a>. The
new <code>Service</code>s future will consist of this services future, followed
by the future returned by calling the chained function with the futures
<a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output" title="associated type core::future::future::Future::Output"><code>Output</code></a> type. The chained function is called regardless of whether
this services future completes with a successful response or with an
error.</p>
<p>This method can be thought of as an equivalent to the <a href="https://docs.rs/futures"><code>futures</code>
crate</a>s <a href="https://docs.rs/futures/latest/futures/future/trait.FutureExt.html#method.then"><code>FutureExt::then</code></a> combinator, but acting on <code>Service</code>s that
<em>return</em> futures, rather than on an individual future. Similarly to that
combinator, <a href="trait.ServiceExt.html#method.then" title="method tower::ServiceExt::then"><code>ServiceExt::then</code></a> can be used to implement asynchronous
error recovery, by calling some asynchronous function with errors
returned by this service. Alternatively, it may also be used to call a
fallible async function with the successful response of this service.</p>
<p>This method can be used to change the <a href="trait.Service.html#associatedtype.Response" title="associated type tower::Service::Response"><code>Response</code></a> type of the service
into a different type. It can also be used to change the <a href="trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Error</code></a> type
of the service. However, because the <code>then</code> function is not applied
to the errors returned by the services <a href="trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>poll_ready</code></a> method, it must
be possible to convert the services <a href="trait.Service.html#associatedtype.Error" title="associated type tower::Service::Error"><code>Error</code></a> type into the error type
returned by the <code>then</code> future. This is trivial when the function
returns the same error type as the service, but in other cases, it can
be useful to use <a href="type.BoxError.html" title="type tower::BoxError"><code>BoxError</code></a> to erase differing error types.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// A service returning Result&lt;Record, DbError&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="comment">// An async function that attempts to recover from errors returned by the
// database.
</span><span class="kw">async fn </span>recover_from_error(error: DbError) -&gt; <span class="prelude-ty">Result</span>&lt;Record, DbError&gt; {
<span class="comment">// ...
</span>}
<span class="comment">// If the database service returns an error, attempt to recover by
// calling `recover_from_error`. Otherwise, return the successful response.
</span><span class="kw">let </span><span class="kw-2">mut </span>new_service = service.then(|result| <span class="kw">async move </span>{
<span class="kw">match </span>result {
<span class="prelude-val">Ok</span>(record) =&gt; <span class="prelude-val">Ok</span>(record),
<span class="prelude-val">Err</span>(e) =&gt; recover_from_error(e).<span class="kw">await</span>,
}
});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>record = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.map_future" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#937-945">Source</a><h4 class="code-header">fn <a href="#method.map_future" class="fn">map_future</a>&lt;F, Fut, Response, Error&gt;(self, f: F) -&gt; <a class="struct" href="util/struct.MapFuture.html" title="struct tower::util::MapFuture">MapFuture</a>&lt;Self, F&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>) -&gt; Fut,
Error: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,
Fut: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Response, Error&gt;&gt;,</div></h4></section></summary><div class="docblock"><p>Composes a function that transforms futures produced by the service.</p>
<p>This takes a function or closure returning a future computed from the future returned by
the services <a href="trait.Service.html#tymethod.call" title="method tower::Service::call"><code>call</code></a> method, as opposed to the responses produced by the future.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::time::Duration;
<span class="kw">use </span>tokio::time::timeout;
<span class="comment">// A service returning Result&lt;Record, DbError&gt;
</span><span class="kw">let </span>service = DatabaseService::new(<span class="string">"127.0.0.1:8080"</span>);
<span class="kw">let </span><span class="kw-2">mut </span>new_service = service.map_future(|future| <span class="kw">async move </span>{
<span class="kw">let </span>res = timeout(Duration::from_secs(<span class="number">1</span>), future).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, BoxError&gt;(res)
});
<span class="comment">// Call the new service
</span><span class="kw">let </span>id = <span class="number">13</span>;
<span class="kw">let </span>record = new_service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(id)
.<span class="kw">await</span><span class="question-mark">?</span>;</code></pre></div>
<p>Note that normally you wouldnt implement timeouts like this and instead use <a href="timeout/struct.Timeout.html" title="struct tower::timeout::Timeout"><code>Timeout</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.boxed" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#987-993">Source</a><h4 class="code-header">fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="util/struct.BoxService.html" title="struct tower::util::BoxService">BoxService</a>&lt;Request, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Convert the service into a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> trait object.</p>
<p>See <a href="util/struct.BoxService.html" title="struct tower::util::BoxService"><code>BoxService</code></a> for more details.</p>
<p>If <code>Self</code> implements the <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> trait, the <a href="trait.ServiceExt.html#method.boxed_clone"><code>boxed_clone</code></a> method
can be used instead, to produce a boxed service which will also
implement <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a>.</p>
<h5 id="example-4"><a class="doc-anchor" href="#example-4">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::{Service, ServiceExt, BoxError, service_fn, util::BoxService};
<span class="kw">let </span>service = service_fn(|req: Request| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, BoxError&gt;(Response::new())
});
<span class="kw">let </span>service: BoxService&lt;Request, Response, BoxError&gt; = service
.map_request(|req| {
<span class="macro">println!</span>(<span class="string">"received request"</span>);
req
})
.map_response(|res| {
<span class="macro">println!</span>(<span class="string">"response produced"</span>);
res
})
.boxed();</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.boxed_clone" class="method"><a class="src rightside" href="../src/tower/util/mod.rs.html#1036-1042">Source</a><h4 class="code-header">fn <a href="#method.boxed_clone" class="fn">boxed_clone</a>(self) -&gt; <a class="struct" href="util/struct.BoxCloneService.html" title="struct tower::util::BoxCloneService">BoxCloneService</a>&lt;Request, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,
Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Convert the service into a <a href="trait.Service.html" title="trait tower::Service"><code>Service</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> trait object.</p>
<p>This is similar to the <a href="trait.ServiceExt.html#method.boxed"><code>boxed</code></a> method, but it requires that <code>Self</code> implement
<a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a>, and the returned boxed service implements <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a>.
See <a href="util/struct.BoxCloneService.html" title="struct tower::util::BoxCloneService"><code>BoxCloneService</code></a> for more details.</p>
<h5 id="example-5"><a class="doc-anchor" href="#example-5">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::{Service, ServiceExt, BoxError, service_fn, util::BoxCloneService};
<span class="kw">let </span>service = service_fn(|req: Request| <span class="kw">async </span>{
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, BoxError&gt;(Response::new())
});
<span class="kw">let </span>service: BoxCloneService&lt;Request, Response, BoxError&gt; = service
.map_request(|req| {
<span class="macro">println!</span>(<span class="string">"received request"</span>);
req
})
.map_response(|res| {
<span class="macro">println!</span>(<span class="string">"response produced"</span>);
res
})
.boxed_clone();
<span class="comment">// The boxed service can still be cloned.
</span>service.clone();</code></pre></div></div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-ServiceExt%3CRequest%3E-for-T" class="impl"><a class="src rightside" href="../src/tower/util/mod.rs.html#1045">Source</a><a href="#impl-ServiceExt%3CRequest%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T, Request&gt; <a class="trait" href="trait.ServiceExt.html" title="trait tower::ServiceExt">ServiceExt</a>&lt;Request&gt; for T<div class="where">where
T: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></div><script src="../trait.impl/tower/util/trait.ServiceExt.js" async></script><script type="text/json" id="notable-traits-data">{"Oneshot<Self, Request>":"<h3>Notable traits for <code><a class=\"struct\" href=\"util/struct.Oneshot.html\" title=\"struct tower::util::Oneshot\">Oneshot</a>&lt;S, Req&gt;</code></h3><pre><code><div class=\"where\">impl&lt;S, Req&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"util/struct.Oneshot.html\" title=\"struct tower::util::Oneshot\">Oneshot</a>&lt;S, Req&gt;<div class=\"where\">where\n S: <a class=\"trait\" href=\"trait.Service.html\" title=\"trait tower::Service\">Service</a>&lt;Req&gt;,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;S::<a class=\"associatedtype\" href=\"trait.Service.html#associatedtype.Response\" title=\"type tower::Service::Response\">Response</a>, S::<a class=\"associatedtype\" href=\"trait.Service.html#associatedtype.Error\" title=\"type tower::Service::Error\">Error</a>&gt;;</div>","Ready<'_, Self, Request>":"<h3>Notable traits for <code><a class=\"struct\" href=\"util/struct.Ready.html\" title=\"struct tower::util::Ready\">Ready</a>&lt;'a, T, Request&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a, T, Request&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"util/struct.Ready.html\" title=\"struct tower::util::Ready\">Ready</a>&lt;'a, T, Request&gt;<div class=\"where\">where\n T: <a class=\"trait\" href=\"trait.Service.html\" title=\"trait tower::Service\">Service</a>&lt;Request&gt;,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.reference.html\">&amp;'a mut T</a>, T::<a class=\"associatedtype\" href=\"trait.Service.html#associatedtype.Error\" title=\"type tower::Service::Error\">Error</a>&gt;;</div>","ReadyOneshot<Self, Request>":"<h3>Notable traits for <code><a class=\"struct\" href=\"util/struct.ReadyOneshot.html\" title=\"struct tower::util::ReadyOneshot\">ReadyOneshot</a>&lt;T, Request&gt;</code></h3><pre><code><div class=\"where\">impl&lt;T, Request&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a> for <a class=\"struct\" href=\"util/struct.ReadyOneshot.html\" title=\"struct tower::util::ReadyOneshot\">ReadyOneshot</a>&lt;T, Request&gt;<div class=\"where\">where\n T: <a class=\"trait\" href=\"trait.Service.html\" title=\"trait tower::Service\">Service</a>&lt;Request&gt;,</div></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html#associatedtype.Output\" class=\"associatedtype\">Output</a> = <a class=\"enum\" href=\"https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;T, T::<a class=\"associatedtype\" href=\"trait.Service.html#associatedtype.Error\" title=\"type tower::Service::Error\">Error</a>&gt;;</div>"}</script></section></div></main></body></html>

View File

@@ -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="Alias for a type-erased error type."><title>BoxError in tower - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[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="#">BoxError</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">BoxError</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate tower</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">tower</a></div><h1>Type Alias <span class="type">BoxError</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/tower/lib.rs.html#228">Source</a> </span></div><pre class="rust item-decl"><code>pub type BoxError = <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/error/trait.Error.html" title="trait core::error::Error">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>&gt;;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Alias for a type-erased error type.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct BoxError(<span class="comment">/* private fields */</span>);</code></pre><script src="../type.impl/alloc/boxed/struct.Box.js" data-self-path="tower::BoxError" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/struct.AndThen.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/struct.AndThen.html">../../../tower/util/struct.AndThen.html</a>...</p>
<script>location.replace("../../../tower/util/struct.AndThen.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/future/struct.AndThenFuture.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/future/struct.AndThenFuture.html">../../../tower/util/future/struct.AndThenFuture.html</a>...</p>
<script>location.replace("../../../tower/util/future/struct.AndThenFuture.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/struct.AndThenLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/struct.AndThenLayer.html">../../../tower/util/struct.AndThenLayer.html</a>...</p>
<script>location.replace("../../../tower/util/struct.AndThenLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.BoxLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.BoxLayer.html">../../../../tower/util/struct.BoxLayer.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.BoxLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.BoxCloneServiceLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.BoxCloneServiceLayer.html">../../../../tower/util/struct.BoxCloneServiceLayer.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.BoxCloneServiceLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.BoxCloneSyncServiceLayer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.BoxCloneSyncServiceLayer.html">../../../../tower/util/struct.BoxCloneSyncServiceLayer.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.BoxCloneSyncServiceLayer.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.BoxService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.BoxService.html">../../../../tower/util/struct.BoxService.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.BoxService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.UnsyncBoxService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.UnsyncBoxService.html">../../../../tower/util/struct.UnsyncBoxService.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.UnsyncBoxService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/struct.BoxCloneService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/struct.BoxCloneService.html">../../../tower/util/struct.BoxCloneService.html</a>...</p>
<script>location.replace("../../../tower/util/struct.BoxCloneService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/struct.BoxCloneSyncService.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/struct.BoxCloneSyncService.html">../../../tower/util/struct.BoxCloneSyncService.html</a>...</p>
<script>location.replace("../../../tower/util/struct.BoxCloneSyncService.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.CallAll.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.CallAll.html">../../../../tower/util/struct.CallAll.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.CallAll.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tower/util/struct.CallAllUnordered.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tower/util/struct.CallAllUnordered.html">../../../../tower/util/struct.CallAllUnordered.html</a>...</p>
<script>location.replace("../../../../tower/util/struct.CallAllUnordered.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/enum.Either.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/enum.Either.html">../../../tower/util/enum.Either.html</a>...</p>
<script>location.replace("../../../tower/util/enum.Either.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tower/util/future/struct.EitherResponseFuture.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tower/util/future/struct.EitherResponseFuture.html">../../../tower/util/future/struct.EitherResponseFuture.html</a>...</p>
<script>location.replace("../../../tower/util/future/struct.EitherResponseFuture.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -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="Error types"><title>tower::util::error - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module error</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module error</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 tower::<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">tower</a>::<wbr><a href="../index.html">util</a></div><h1>Module <span>error</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/util/mod.rs.html#51">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Error types</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="optional/index.html" title="mod tower::util::error::optional">optional</a></dt><dd>Error types for <a href="../struct.Optional.html" title="struct tower::util::Optional"><code>Optional</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -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="Error types for `Optional`."><title>tower::util::error::optional - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module optional</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module optional</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 tower::<wbr>util::<wbr>error</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">tower</a>::<wbr><a href="../../index.html">util</a>::<wbr><a href="../index.html">error</a></div><h1>Module <span>optional</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/tower/util/optional/error.rs.html#1-21">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Error types for <a href="../../struct.Optional.html" title="struct tower::util::Optional"><code>Optional</code></a>.</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.None.html" title="struct tower::util::error::optional::None">None</a></dt><dd>Error returned if the inner <a href="../../../trait.Service.html" title="trait tower::Service"><code>Service</code></a> has not been set.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["None"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["optional"]};

View File

@@ -0,0 +1,29 @@
<!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="Returns a new `FutureService` for the given future."><title>future_service in tower::util - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">future_service</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">future_<wbr>service</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li><li><a href="#regarding-the-unpin-bound" title="Regarding the `Unpin` bound">Regarding the <code>Unpin</code> bound</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<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">tower</a>::<wbr><a href="index.html">util</a></div><h1>Function <span class="fn">future_<wbr>service</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/util/future_service.rs.html#48-54">Source</a> </span></div><pre class="rust item-decl"><code>pub fn future_service&lt;F, S, R, E&gt;(future: F) -&gt; <a class="struct" href="struct.FutureService.html" title="struct tower::util::FutureService">FutureService</a>&lt;F, S&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;S, E&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
S: <a class="trait" href="../trait.Service.html" title="trait tower::Service">Service</a>&lt;R, Error = E&gt;,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="struct.FutureService.html" title="struct tower::util::FutureService"><code>FutureService</code></a> for the given future.</p>
<p>A <a href="struct.FutureService.html" title="struct tower::util::FutureService"><code>FutureService</code></a> allows you to treat a future that resolves to a service as a service. This
can be useful for services that are created asynchronously.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::{service_fn, Service, ServiceExt};
<span class="kw">use </span>tower::util::future_service;
<span class="kw">use </span>std::convert::Infallible;
<span class="comment">// A future which outputs a type implementing `Service`.
</span><span class="kw">let </span>future_of_a_service = <span class="kw">async </span>{
<span class="kw">let </span>svc = service_fn(|_req: ()| <span class="kw">async </span>{ <span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(<span class="string">"ok"</span>) });
<span class="prelude-val">Ok</span>::&lt;<span class="kw">_</span>, Infallible&gt;(svc)
};
<span class="comment">// Wrap the future with a `FutureService`, allowing it to be used
// as a service without awaiting the future's completion:
</span><span class="kw">let </span><span class="kw-2">mut </span>svc = future_service(Box::pin(future_of_a_service));
<span class="comment">// Now, when we wait for the service to become ready, it will
// drive the future to completion internally.
</span><span class="kw">let </span>svc = svc.ready().<span class="kw">await</span>.unwrap();
<span class="kw">let </span>res = svc.call(()).<span class="kw">await</span>.unwrap();</code></pre></div><h2 id="regarding-the-unpin-bound"><a class="doc-anchor" href="#regarding-the-unpin-bound">§</a>Regarding the <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin"><code>Unpin</code></a> bound</h2>
<p>The <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin"><code>Unpin</code></a> bound on <code>F</code> is necessary because the future will be polled in
<a href="../trait.Service.html#tymethod.poll_ready" title="method tower::Service::poll_ready"><code>Service::poll_ready</code></a> which doesnt have a pinned receiver (it takes <code>&amp;mut self</code> and not <code>self: Pin&lt;&amp;mut Self&gt;</code>). So we cannot put the future into a <code>Pin</code> without requiring <code>Unpin</code>.</p>
<p>This will most likely come up if youre calling <code>future_service</code> with an async block. In that
case you can use <code>Box::pin(async { ... })</code> as shown in the example.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Convert an `Option&#60;Layer&#62;` into a `Layer`."><title>option_layer in tower::util - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">option_layer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<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">tower</a>::<wbr><a href="index.html">util</a></div><h1>Function <span class="fn">option_<wbr>layer</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/util/mod.rs.html#1067-1073">Source</a> </span></div><pre class="rust item-decl"><code>pub fn option_layer&lt;L&gt;(layer: <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;L&gt;) -&gt; <a class="enum" href="enum.Either.html" title="enum tower::util::Either">Either</a>&lt;L, <a class="struct" href="../layer/util/struct.Identity.html" title="struct tower::layer::util::Identity">Identity</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Convert an <code>Option&lt;Layer&gt;</code> into a <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::util::option_layer;
<span class="comment">// Layer to apply a timeout if configured
</span><span class="kw">let </span>maybe_timeout = option_layer(timeout.map(TimeoutLayer::new));
ServiceBuilder::new()
.layer(maybe_timeout)
.service(svc);</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,19 @@
<!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="Returns a new `ServiceFn` with the given closure."><title>service_fn in tower::util - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">service_fn</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">service_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tower::<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">tower</a>::<wbr><a href="index.html">util</a></div><h1>Function <span class="fn">service_<wbr>fn</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/util/service_fn.rs.html#46-48">Source</a> </span></div><pre class="rust item-decl"><code>pub fn service_fn&lt;T&gt;(f: T) -&gt; <a class="struct" href="struct.ServiceFn.html" title="struct tower::util::ServiceFn">ServiceFn</a>&lt;T&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="struct.ServiceFn.html" title="struct tower::util::ServiceFn"><code>ServiceFn</code></a> with the given closure.</p>
<p>This lets you build a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> from an async function that returns a <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result</code></a>.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower::{service_fn, Service, ServiceExt, BoxError};
<span class="kw">async fn </span>handle(request: Request) -&gt; <span class="prelude-ty">Result</span>&lt;Response, BoxError&gt; {
<span class="kw">let </span>response = Response::new(<span class="string">"Hello, World!"</span>);
<span class="prelude-val">Ok</span>(response)
}
<span class="kw">let </span><span class="kw-2">mut </span>service = service_fn(handle);
<span class="kw">let </span>response = service
.ready()
.<span class="kw">await</span><span class="question-mark">?
</span>.call(Request::new())
.<span class="kw">await</span><span class="question-mark">?</span>;
<span class="macro">assert_eq!</span>(<span class="string">"Hello, World!"</span>, response.into_body());</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -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="Future types"><title>tower::util::future - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module future</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module future</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 tower::<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">tower</a>::<wbr><a href="../index.html">util</a></div><h1>Module <span>future</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/tower/util/mod.rs.html#57">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Future types</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="optional/index.html" title="mod tower::util::future::optional">optional</a></dt><dd>Future types for <a href="../struct.Optional.html" title="struct tower::util::Optional"><code>Optional</code></a>.</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.AndThenFuture.html" title="struct tower::util::future::AndThenFuture">AndThen<wbr>Future</a></dt><dd>Response future from <a href="../struct.AndThen.html" title="struct tower::util::AndThen"><code>AndThen</code></a> services.</dd><dt><a class="struct" href="struct.EitherResponseFuture.html" title="struct tower::util::future::EitherResponseFuture">Either<wbr>Response<wbr>Future</a></dt><dd>Response future for <a href="../enum.Either.html" title="enum tower::util::Either"><code>Either</code></a>.</dd><dt><a class="struct" href="struct.MapErrFuture.html" title="struct tower::util::future::MapErrFuture">MapErr<wbr>Future</a></dt><dd>Response future from <a href="../struct.MapErr.html" title="struct tower::util::MapErr"><code>MapErr</code></a> services.</dd><dt><a class="struct" href="struct.MapResponseFuture.html" title="struct tower::util::future::MapResponseFuture">MapResponse<wbr>Future</a></dt><dd>Response future from <a href="../struct.MapResponse.html" title="struct tower::util::MapResponse"><code>MapResponse</code></a> services.</dd><dt><a class="struct" href="struct.MapResultFuture.html" title="struct tower::util::future::MapResultFuture">MapResult<wbr>Future</a></dt><dd>Response future from <a href="../struct.MapResult.html" title="struct tower::util::MapResult"><code>MapResult</code></a> services.</dd><dt><a class="struct" href="struct.ThenFuture.html" title="struct tower::util::future::ThenFuture">Then<wbr>Future</a></dt><dd>Response future from <a href="../struct.Then.html" title="struct tower::util::Then"><code>Then</code></a> services.</dd></dl></section></div></main></body></html>

View File

@@ -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="Future types for `Optional`."><title>tower::util::future::optional - 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="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module optional</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module optional</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 tower::<wbr>util::<wbr>future</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">tower</a>::<wbr><a href="../../index.html">util</a>::<wbr><a href="../index.html">future</a></div><h1>Module <span>optional</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/tower/util/optional/future.rs.html#1-39">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Future types for <a href="../../struct.Optional.html" title="struct tower::util::Optional"><code>Optional</code></a>.</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.ResponseFuture.html" title="struct tower::util::future::optional::ResponseFuture">Response<wbr>Future</a></dt><dd>Response future returned by <a href="../../struct.Optional.html" title="struct tower::util::Optional"><code>Optional</code></a>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["ResponseFuture"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["optional"],"struct":["AndThenFuture","EitherResponseFuture","MapErrFuture","MapResponseFuture","MapResultFuture","ThenFuture"]};

Some files were not shown because too many files have changed in this diff Show More