Files
GopherGate/target/doc/tower/trait.Service.html
2026-02-26 12:00:21 -05:00

328 lines
88 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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 asynchronous function from a `Request` to a `Response`."><title>Service 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="#">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="#">Service</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#functional" title="Functional">Functional</a></li><li><a href="#server" title="Server">Server</a></li><li><a href="#client" title="Client">Client</a></li><li><a href="#middleware--layer" title="Middleware / Layer">Middleware / Layer</a></li><li><a href="#backpressure" title="Backpressure">Backpressure</a></li><li><a href="#be-careful-when-cloning-inner-services" title="Be careful when cloning inner services">Be careful when cloning inner services</a></li></ul><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.Response" title="Response">Response</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.call" title="call">call</a></li><li><a href="#tymethod.poll_ready" title="poll_ready">poll_ready</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Service%3CRequest%3E-for-%26mut+S" title="&#38;&#39;a mut S">&#38;&#39;a mut S</a></li><li><a href="#impl-Service%3CRequest%3E-for-Box%3CS%3E" title="Box&#60;S&#62;">Box&#60;S&#62;</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</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_service/lib.rs.html#311">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Service&lt;Request&gt; {
type <a href="#associatedtype.Response" class="associatedtype">Response</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.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;;
// 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.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.call" class="fn">call</a>(&amp;mut self, req: Request) -&gt; Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An asynchronous function from a <code>Request</code> to a <code>Response</code>.</p>
<p>The <code>Service</code> trait is a simplified interface making it easy to write
network applications in a modular and reusable way, decoupled from the
underlying protocol. It is one of Towers fundamental abstractions.</p>
<h2 id="functional"><a class="doc-anchor" href="#functional">§</a>Functional</h2>
<p>A <code>Service</code> is a function of a <code>Request</code>. It immediately returns a
<code>Future</code> representing the eventual completion of processing the
request. The actual request processing may happen at any time in the
future, on any thread or executor. The processing may depend on calling
other services. At some point in the future, the processing will complete,
and the <code>Future</code> will resolve to a response or error.</p>
<p>At a high level, the <code>Service::call</code> function represents an RPC request. The
<code>Service</code> value can be a server or a client.</p>
<h2 id="server"><a class="doc-anchor" href="#server">§</a>Server</h2>
<p>An RPC server <em>implements</em> the <code>Service</code> trait. Requests received by the
server over the network are deserialized and then passed as an argument to the
server value. The returned response is sent back over the network.</p>
<p>As an example, here is how an HTTP request is processed by a server:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>http::{Request, Response, StatusCode};
<span class="kw">struct </span>HelloWorld;
<span class="kw">impl </span>Service&lt;Request&lt;Vec&lt;u8&gt;&gt;&gt; <span class="kw">for </span>HelloWorld {
<span class="kw">type </span>Response = Response&lt;Vec&lt;u8&gt;&gt;;
<span class="kw">type </span>Error = http::Error;
<span class="kw">type </span>Future = Pin&lt;Box&lt;<span class="kw">dyn </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Response, <span class="self">Self</span>::Error&gt;&gt;&gt;&gt;;
<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; {
Poll::Ready(<span class="prelude-val">Ok</span>(()))
}
<span class="kw">fn </span>call(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: Request&lt;Vec&lt;u8&gt;&gt;) -&gt; <span class="self">Self</span>::Future {
<span class="comment">// create the body
</span><span class="kw">let </span>body: Vec&lt;u8&gt; = <span class="string">"hello, world!\n"
</span>.as_bytes()
.to_owned();
<span class="comment">// Create the HTTP response
</span><span class="kw">let </span>resp = Response::builder()
.status(StatusCode::OK)
.body(body)
.expect(<span class="string">"Unable to create `http::Response`"</span>);
<span class="comment">// create a response in a future.
</span><span class="kw">let </span>fut = <span class="kw">async </span>{
<span class="prelude-val">Ok</span>(resp)
};
<span class="comment">// Return the response as an immediate future
</span>Box::pin(fut)
}
}</code></pre></div><h2 id="client"><a class="doc-anchor" href="#client">§</a>Client</h2>
<p>A client consumes a service by using a <code>Service</code> value. The client may
issue requests by invoking <code>call</code> and passing the request as an argument.
It then receives the response by waiting for the returned future.</p>
<p>As an example, here is how a Redis request would be issued:</p>
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested"></a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>client = redis::Client::new()
.connect(<span class="string">"127.0.0.1:6379"</span>.parse().unwrap())
.unwrap();
<span class="kw">let </span>resp = client.call(Cmd::set(<span class="string">"foo"</span>, <span class="string">"this is the value of foo"</span>)).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">// Wait for the future to resolve
</span><span class="macro">println!</span>(<span class="string">"Redis response: {:?}"</span>, resp);</code></pre></div><h2 id="middleware--layer"><a class="doc-anchor" href="#middleware--layer">§</a>Middleware / Layer</h2>
<p>More often than not, all the pieces needed for writing robust, scalable
network applications are the same no matter the underlying protocol. By
unifying the API for both clients and servers in a protocol agnostic way,
it is possible to write middleware that provide these pieces in a
reusable way.</p>
<p>Take timeouts as an example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tower_service::Service;
<span class="kw">use </span>tower_layer::Layer;
<span class="kw">use </span>futures::FutureExt;
<span class="kw">use </span>std::future::Future;
<span class="kw">use </span>std::task::{Context, Poll};
<span class="kw">use </span>std::time::Duration;
<span class="kw">use </span>std::pin::Pin;
<span class="kw">use </span>std::fmt;
<span class="kw">use </span>std::error::Error;
<span class="comment">// Our timeout service, which wraps another service and
// adds a timeout to its response future.
</span><span class="kw">pub struct </span>Timeout&lt;T&gt; {
inner: T,
timeout: Duration,
}
<span class="kw">impl</span>&lt;T&gt; Timeout&lt;T&gt; {
<span class="kw">pub const fn </span>new(inner: T, timeout: Duration) -&gt; Timeout&lt;T&gt; {
Timeout {
inner,
timeout
}
}
}
<span class="comment">// The error returned if processing a request timed out
</span><span class="attr">#[derive(Debug)]
</span><span class="kw">pub struct </span>Expired;
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>Expired {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"expired"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>Expired {}
<span class="comment">// We can implement `Service` for `Timeout&lt;T&gt;` if `T` is a `Service`
</span><span class="kw">impl</span>&lt;T, Request&gt; Service&lt;Request&gt; <span class="kw">for </span>Timeout&lt;T&gt;
<span class="kw">where
</span>T: Service&lt;Request&gt;,
T::Future: <span class="lifetime">'static</span>,
T::Error: Into&lt;Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;&gt; + <span class="lifetime">'static</span>,
T::Response: <span class="lifetime">'static</span>,
{
<span class="comment">// `Timeout` doesn't modify the response type, so we use `T`'s response type
</span><span class="kw">type </span>Response = T::Response;
<span class="comment">// Errors may be either `Expired` if the timeout expired, or the inner service's
// `Error` type. Therefore, we return a boxed `dyn Error + Send + Sync` trait object to erase
// the error's type.
</span><span class="kw">type </span>Error = Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;;
<span class="kw">type </span>Future = Pin&lt;Box&lt;<span class="kw">dyn </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Response, <span class="self">Self</span>::Error&gt;&gt;&gt;&gt;;
<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="comment">// Our timeout service is ready if the inner service is ready.
// This is how backpressure can be propagated through a tree of nested services.
</span><span class="self">self</span>.inner.poll_ready(cx).map_err(Into::into)
}
<span class="kw">fn </span>call(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: Request) -&gt; <span class="self">Self</span>::Future {
<span class="comment">// Create a future that completes after `self.timeout`
</span><span class="kw">let </span>timeout = tokio::time::sleep(<span class="self">self</span>.timeout);
<span class="comment">// Call the inner service and get a future that resolves to the response
</span><span class="kw">let </span>fut = <span class="self">self</span>.inner.call(req);
<span class="comment">// Wrap those two futures in another future that completes when either one completes
//
// If the inner service is too slow the `sleep` future will complete first
// And an error will be returned and `fut` will be dropped and not polled again
//
// We have to box the errors so the types match
</span><span class="kw">let </span>f = <span class="kw">async move </span>{
<span class="macro">tokio::select!</span> {
res = fut =&gt; {
res.map_err(|err| err.into())
},
<span class="kw">_ </span>= timeout =&gt; {
<span class="prelude-val">Err</span>(Box::new(Expired) <span class="kw">as </span>Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;)
},
}
};
Box::pin(f)
}
}
<span class="comment">// A layer for wrapping services in `Timeout`
</span><span class="kw">pub struct </span>TimeoutLayer(Duration);
<span class="kw">impl </span>TimeoutLayer {
<span class="kw">pub const fn </span>new(delay: Duration) -&gt; <span class="self">Self </span>{
TimeoutLayer(delay)
}
}
<span class="kw">impl</span>&lt;S&gt; Layer&lt;S&gt; <span class="kw">for </span>TimeoutLayer {
<span class="kw">type </span>Service = Timeout&lt;S&gt;;
<span class="kw">fn </span>layer(<span class="kw-2">&amp;</span><span class="self">self</span>, service: S) -&gt; Timeout&lt;S&gt; {
Timeout::new(service, <span class="self">self</span>.<span class="number">0</span>)
}
}</code></pre></div>
<p>The above timeout implementation is decoupled from the underlying protocol
and is also decoupled from client or server concerns. In other words, the
same timeout middleware could be used in either a client or a server.</p>
<h2 id="backpressure"><a class="doc-anchor" href="#backpressure">§</a>Backpressure</h2>
<p>Calling a <code>Service</code> which is at capacity (i.e., it is temporarily unable to process a
request) should result in an error. The caller is responsible for ensuring
that the service is ready to receive the request before calling it.</p>
<p><code>Service</code> provides a mechanism by which the caller is able to coordinate
readiness. <code>Service::poll_ready</code> returns <code>Ready</code> if the service expects that
it is able to process a request.</p>
<h2 id="be-careful-when-cloning-inner-services"><a class="doc-anchor" href="#be-careful-when-cloning-inner-services">§</a>Be careful when cloning inner services</h2>
<p>Services are permitted to panic if <code>call</code> is invoked without obtaining <code>Poll::Ready(Ok(()))</code>
from <code>poll_ready</code>. You should therefore be careful when cloning services for example to move
them into boxed futures. Even though the original service is ready, the clone might not be.</p>
<p>Therefore this kind of code is wrong and might panic:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">struct </span>Wrapper&lt;S&gt; {
inner: S,
}
<span class="kw">impl</span>&lt;R, S&gt; Service&lt;R&gt; <span class="kw">for </span>Wrapper&lt;S&gt;
<span class="kw">where
</span>S: Service&lt;R&gt; + Clone + <span class="lifetime">'static</span>,
R: <span class="lifetime">'static</span>,
{
<span class="kw">type </span>Response = S::Response;
<span class="kw">type </span>Error = S::Error;
<span class="kw">type </span>Future = Pin&lt;Box&lt;<span class="kw">dyn </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Response, <span class="self">Self</span>::Error&gt;&gt;&gt;&gt;;
<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>.inner.poll_ready(cx)
}
<span class="kw">fn </span>call(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: R) -&gt; <span class="self">Self</span>::Future {
<span class="kw">let </span><span class="kw-2">mut </span>inner = <span class="self">self</span>.inner.clone();
Box::pin(<span class="kw">async move </span>{
<span class="comment">// `inner` might not be ready since its a clone
</span>inner.call(req).<span class="kw">await
</span>})
}
}</code></pre></div>
<p>You should instead use <a href="https://doc.rust-lang.org/1.93.1/core/mem/fn.replace.html" title="fn core::mem::replace"><code>std::mem::replace</code></a> to take the service that was ready:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">struct </span>Wrapper&lt;S&gt; {
inner: S,
}
<span class="kw">impl</span>&lt;R, S&gt; Service&lt;R&gt; <span class="kw">for </span>Wrapper&lt;S&gt;
<span class="kw">where
</span>S: Service&lt;R&gt; + Clone + <span class="lifetime">'static</span>,
R: <span class="lifetime">'static</span>,
{
<span class="kw">type </span>Response = S::Response;
<span class="kw">type </span>Error = S::Error;
<span class="kw">type </span>Future = Pin&lt;Box&lt;<span class="kw">dyn </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Response, <span class="self">Self</span>::Error&gt;&gt;&gt;&gt;;
<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>.inner.poll_ready(cx)
}
<span class="kw">fn </span>call(<span class="kw-2">&amp;mut </span><span class="self">self</span>, req: R) -&gt; <span class="self">Self</span>::Future {
<span class="kw">let </span>clone = <span class="self">self</span>.inner.clone();
<span class="comment">// take the service that was ready
</span><span class="kw">let </span><span class="kw-2">mut </span>inner = std::mem::replace(<span class="kw-2">&amp;mut </span><span class="self">self</span>.inner, clone);
Box::pin(<span class="kw">async move </span>{
inner.call(req).<span class="kw">await
</span>})
}
}</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.Response" class="method"><a class="src rightside" href="../src/tower_service/lib.rs.html#313">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_service/lib.rs.html#316">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.Future" class="method"><a class="src rightside" href="../src/tower_service/lib.rs.html#319">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.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;</h4></section></summary><div class="docblock"><p>The future response value.</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_service/lib.rs.html#340">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.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns <code>Poll::Ready(Ok(()))</code> when the service is able to process requests.</p>
<p>If the service is at capacity, then <code>Poll::Pending</code> is returned and the task
is notified when the service becomes ready again. This function is
expected to be called while on a task. Generally, this can be done with
a simple <code>futures::future::poll_fn</code> call.</p>
<p>If <code>Poll::Ready(Err(_))</code> is returned, the service is no longer able to service requests
and the caller should discard the service instance.</p>
<p>Once <code>poll_ready</code> returns <code>Poll::Ready(Ok(()))</code>, a request may be dispatched to the
service using <code>call</code>. Until a request is dispatched, repeated calls to
<code>poll_ready</code> must return either <code>Poll::Ready(Ok(()))</code> or <code>Poll::Ready(Err(_))</code>.</p>
<p>Note that <code>poll_ready</code> may reserve shared resources that are consumed in a subsequent
invocation of <code>call</code>. Thus, it is critical for implementations to not assume that <code>call</code>
will always be invoked and to ensure that such resources are released if the service is
dropped before <code>call</code> is invoked or the future returned by <code>call</code> is dropped before it
is polled.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.call" class="method"><a class="src rightside" href="../src/tower_service/lib.rs.html#355">Source</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&amp;mut self, req: Request) -&gt; Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></summary><div class="docblock"><p>Process the request and return the response asynchronously.</p>
<p>This function is expected to be callable off task. As such,
implementations should take care to not call <code>poll_ready</code>.</p>
<p>Before dispatching a request, <code>poll_ready</code> must be called and return
<code>Poll::Ready(Ok(()))</code>.</p>
<h5 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h5>
<p>Implementations are permitted to panic if <code>call</code> is invoked without
obtaining <code>Poll::Ready(Ok(()))</code> from <code>poll_ready</code>.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-%26mut+S" class="impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#358-360">Source</a><a href="#impl-Service%3CRequest%3E-for-%26mut+S" class="anchor">§</a><h3 class="code-header">impl&lt;'a, S, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a mut S</a><div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; + 'a,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#362">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_service/lib.rs.html#363">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.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#364">Source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</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.Future" title="type tower::Service::Future">Future</a></h4></section><section id="method.poll_ready" class="method trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#366">Source</a><a href="#method.poll_ready" class="anchor">§</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>, &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>&gt;&gt;</h4></section><section id="method.call" class="method trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#370">Source</a><a href="#method.call" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&amp;mut self, request: Request) -&gt; &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.Future" title="type tower::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-Box%3CS%3E" class="impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#375-377">Source</a><a href="#impl-Service%3CRequest%3E-for-Box%3CS%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <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;S&gt;<div class="where">where
S: <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></summary><div class="impl-items"><section id="associatedtype.Response-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#379">Source</a><a href="#associatedtype.Response-2" 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-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#380">Source</a><a href="#associatedtype.Error-2" 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.Future-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#381">Source</a><a href="#associatedtype.Future-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</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.Future" title="type tower::Service::Future">Future</a></h4></section><section id="method.poll_ready-1" class="method trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#383">Source</a><a href="#method.poll_ready-1" class="anchor">§</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>, &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>&gt;&gt;</h4></section><section id="method.call-1" class="method trait-impl"><a class="src rightside" href="../src/tower_service/lib.rs.html#387">Source</a><a href="#method.call-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&amp;mut self, request: Request) -&gt; &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.Future" title="type tower::Service::Future">Future</a></h4></section></div></details><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-Service%3CRequest%3E-for-Either%3CA,+B%3E" class="impl"><a class="src rightside" href="../src/tower/util/either.rs.html#27-57">Source</a><a href="#impl-Service%3CRequest%3E-for-Either%3CA,+B%3E" class="anchor">§</a><h3 class="code-header">impl&lt;A, B, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="enum" href="util/enum.Either.html" title="enum tower::util::Either">Either</a>&lt;A, B&gt;<div class="where">where
A: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
B: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request, Response = A::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>, Error = A::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/either.rs.html#32">Source</a><a href="#associatedtype.Response-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = &lt;A 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-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/either.rs.html#33">Source</a><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;A 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.Future-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/either.rs.html#34">Source</a><a href="#associatedtype.Future-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.EitherResponseFuture.html" title="struct tower::util::future::EitherResponseFuture">EitherResponseFuture</a>&lt;&lt;A 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.Future" title="type tower::Service::Future">Future</a>, &lt;B 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.Future" title="type tower::Service::Future">Future</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CR%3E-for-FutureService%3CF,+S%3E" class="impl"><a class="src rightside" href="../src/tower/util/future_service.rs.html#143-172">Source</a><a href="#impl-Service%3CR%3E-for-FutureService%3CF,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;F, S, R, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R&gt; for <a class="struct" href="util/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></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/future_service.rs.html#148">Source</a><a href="#associatedtype.Response-4" 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;R&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/future_service.rs.html#149">Source</a><a href="#associatedtype.Error-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/future_service.rs.html#150">Source</a><a href="#associatedtype.Future-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = &lt;S as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CTarget%3E-for-AsService%3C'_,+M,+Request%3E" class="impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#233-251">Source</a><a href="#impl-Service%3CTarget%3E-for-AsService%3C'_,+M,+Request%3E" class="anchor">§</a><h3 class="code-header">impl&lt;M, S, Target, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt; for <a class="struct" href="make/struct.AsService.html" title="struct tower::make::AsService">AsService</a>&lt;'_, M, Request&gt;<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-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#238">Source</a><a href="#associatedtype.Response-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</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.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#239">Source</a><a href="#associatedtype.Error-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</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-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#240">Source</a><a href="#associatedtype.Future-5" 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><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CTarget%3E-for-IntoService%3CM,+Request%3E" class="impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#192-210">Source</a><a href="#impl-Service%3CTarget%3E-for-IntoService%3CM,+Request%3E" class="anchor">§</a><h3 class="code-header">impl&lt;M, S, Target, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Target&gt; for <a class="struct" href="make/struct.IntoService.html" title="struct tower::make::IntoService">IntoService</a>&lt;M, Request&gt;<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-6" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#197">Source</a><a href="#associatedtype.Response-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</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.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-6" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#198">Source</a><a href="#associatedtype.Error-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</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-6" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service.rs.html#199">Source</a><a href="#associatedtype.Future-6" 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><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-Retry%3CP,+S%3E" class="impl"><a class="src rightside" href="../src/tower/retry/mod.rs.html#72-94">Source</a><a href="#impl-Service%3CRequest%3E-for-Retry%3CP,+S%3E" class="anchor">§</a><h3 class="code-header">impl&lt;P, S, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="retry/struct.Retry.html" title="struct tower::retry::Retry">Retry</a>&lt;P, S&gt;<div class="where">where
P: <a class="trait" href="retry/trait.Policy.html" title="trait tower::retry::Policy">Policy</a>&lt;Request, 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; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
S: <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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-7" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/retry/mod.rs.html#77">Source</a><a href="#associatedtype.Response-7" 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-7" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/retry/mod.rs.html#78">Source</a><a href="#associatedtype.Error-7" 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.Future-7" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/retry/mod.rs.html#79">Source</a><a href="#associatedtype.Future-7" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="retry/future/struct.ResponseFuture.html" title="struct tower::retry::future::ResponseFuture">ResponseFuture</a>&lt;P, S, Request&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CR%3E-for-MapFuture%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/map_future.rs.html#49-67">Source</a><a href="#impl-Service%3CR%3E-for-MapFuture%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R, S, F, T, E, Fut&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R&gt; for <a class="struct" href="util/struct.MapFuture.html" title="struct tower::util::MapFuture">MapFuture</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R&gt;,
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>(S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a>) -&gt; Fut,
E: <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;S::<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;T, E&gt;&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-8" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_future.rs.html#56">Source</a><a href="#associatedtype.Response-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = T</h4></section><section id="associatedtype.Error-8" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_future.rs.html#57">Source</a><a href="#associatedtype.Error-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-8" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_future.rs.html#58">Source</a><a href="#associatedtype.Future-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = Fut</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CR1%3E-for-MapRequest%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/map_request.rs.html#43-61">Source</a><a href="#impl-Service%3CR1%3E-for-MapRequest%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, R1, R2&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R1&gt; for <a class="struct" href="util/struct.MapRequest.html" title="struct tower::util::MapRequest">MapRequest</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R2&gt;,
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>(R1) -&gt; R2,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-9" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_request.rs.html#48">Source</a><a href="#associatedtype.Response-9" 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;R2&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a></h4></section><section id="associatedtype.Error-9" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_request.rs.html#49">Source</a><a href="#associatedtype.Error-9" 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;R2&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a></h4></section><section id="associatedtype.Future-9" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_request.rs.html#50">Source</a><a href="#associatedtype.Future-9" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = &lt;S as <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;R2&gt;&gt;::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type tower::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-MapErr%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/map_err.rs.html#59-77">Source</a><a href="#impl-Service%3CRequest%3E-for-MapErr%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, Request, Error&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.MapErr.html" title="struct tower::util::MapErr">MapErr</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&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>(S::<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></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-10" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_err.rs.html#64">Source</a><a href="#associatedtype.Response-10" 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-10" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_err.rs.html#65">Source</a><a href="#associatedtype.Error-10" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = Error</h4></section><section id="associatedtype.Future-10" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_err.rs.html#66">Source</a><a href="#associatedtype.Future-10" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.MapErrFuture.html" title="struct tower::util::future::MapErrFuture">MapErrFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-AndThen%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/and_then.rs.html#91-109">Source</a><a href="#impl-Service%3CRequest%3E-for-AndThen%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, Request, Fut&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.AndThen.html" title="struct tower::util::AndThen">AndThen</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
S::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Fut::<a class="associatedtype" href="../futures_core/future/trait.TryFuture.html#associatedtype.Error" title="type futures_core::future::TryFuture::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>(S::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type tower::Service::Response">Response</a>) -&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="../futures_core/future/trait.TryFuture.html" title="trait futures_core::future::TryFuture">TryFuture</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-11" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/and_then.rs.html#98">Source</a><a href="#associatedtype.Response-11" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = &lt;Fut as <a class="trait" href="../futures_core/future/trait.TryFuture.html" title="trait futures_core::future::TryFuture">TryFuture</a>&gt;::<a class="associatedtype" href="../futures_core/future/trait.TryFuture.html#associatedtype.Ok" title="type futures_core::future::TryFuture::Ok">Ok</a></h4></section><section id="associatedtype.Error-11" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/and_then.rs.html#99">Source</a><a href="#associatedtype.Error-11" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = &lt;Fut as <a class="trait" href="../futures_core/future/trait.TryFuture.html" title="trait futures_core::future::TryFuture">TryFuture</a>&gt;::<a class="associatedtype" href="../futures_core/future/trait.TryFuture.html#associatedtype.Error" title="type futures_core::future::TryFuture::Error">Error</a></h4></section><section id="associatedtype.Future-11" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/and_then.rs.html#100">Source</a><a href="#associatedtype.Future-11" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.AndThenFuture.html" title="struct tower::util::future::AndThenFuture">AndThenFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>, Fut, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-MapResponse%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/map_response.rs.html#59-77">Source</a><a href="#impl-Service%3CRequest%3E-for-MapResponse%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, Request, Response&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.MapResponse.html" title="struct tower::util::MapResponse">MapResponse</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&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>(S::<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></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-12" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_response.rs.html#64">Source</a><a href="#associatedtype.Response-12" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = Response</h4></section><section id="associatedtype.Error-12" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_response.rs.html#65">Source</a><a href="#associatedtype.Error-12" 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.Future-12" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_response.rs.html#66">Source</a><a href="#associatedtype.Future-12" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.MapResponseFuture.html" title="struct tower::util::future::MapResponseFuture">MapResponseFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-MapResult%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/map_result.rs.html#59-78">Source</a><a href="#impl-Service%3CRequest%3E-for-MapResult%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, Request, Response, Error&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.MapResult.html" title="struct tower::util::MapResult">MapResult</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
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;S::<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;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;) -&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></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-13" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_result.rs.html#65">Source</a><a href="#associatedtype.Response-13" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = Response</h4></section><section id="associatedtype.Error-13" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_result.rs.html#66">Source</a><a href="#associatedtype.Error-13" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = Error</h4></section><section id="associatedtype.Future-13" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/map_result.rs.html#67">Source</a><a href="#associatedtype.Future-13" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.MapResultFuture.html" title="struct tower::util::future::MapResultFuture">MapResultFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-Then%3CS,+F%3E" class="impl"><a class="src rightside" href="../src/tower/util/then.rs.html#62-82">Source</a><a href="#impl-Service%3CRequest%3E-for-Then%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F, Request, Response, Error, Fut&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.Then.html" title="struct tower::util::Then">Then</a>&lt;S, F&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
S::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&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;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;) -&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></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-14" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/then.rs.html#69">Source</a><a href="#associatedtype.Response-14" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = Response</h4></section><section id="associatedtype.Error-14" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/then.rs.html#70">Source</a><a href="#associatedtype.Error-14" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = Error</h4></section><section id="associatedtype.Future-14" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/then.rs.html#71">Source</a><a href="#associatedtype.Future-14" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/struct.ThenFuture.html" title="struct tower::util::future::ThenFuture">ThenFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>, Fut, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-Timeout%3CS%3E" class="impl"><a class="src rightside" href="../src/tower/timeout/mod.rs.html#48-70">Source</a><a href="#impl-Service%3CRequest%3E-for-Timeout%3CS%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="timeout/struct.Timeout.html" title="struct tower::timeout::Timeout">Timeout</a>&lt;S&gt;<div class="where">where
S: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
S::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="type" href="type.BoxError.html" title="type tower::BoxError">BoxError</a>&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-15" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/timeout/mod.rs.html#53">Source</a><a href="#associatedtype.Response-15" 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-15" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/timeout/mod.rs.html#54">Source</a><a href="#associatedtype.Error-15" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <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.Sync.html" title="trait core::marker::Sync">Sync</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>&gt;</h4></section><section id="associatedtype.Future-15" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/timeout/mod.rs.html#55">Source</a><a href="#associatedtype.Future-15" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="timeout/future/struct.ResponseFuture.html" title="struct tower::timeout::future::ResponseFuture">ResponseFuture</a>&lt;&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.Future" title="type tower::Service::Future">Future</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CT%3E-for-Shared%3CS%3E" class="impl"><a class="src rightside" href="../src/tower/make/make_service/shared.rs.html#83-98">Source</a><a href="#impl-Service%3CT%3E-for-Shared%3CS%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, T&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;T&gt; for <a class="struct" href="make/struct.Shared.html" title="struct tower::make::Shared">Shared</a>&lt;S&gt;<div class="where">where
S: <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.Response-16" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service/shared.rs.html#87">Source</a><a href="#associatedtype.Response-16" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = S</h4></section><section id="associatedtype.Error-16" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service/shared.rs.html#88">Source</a><a href="#associatedtype.Error-16" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section><section id="associatedtype.Future-16" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/make/make_service/shared.rs.html#89">Source</a><a href="#associatedtype.Future-16" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="make/future/struct.SharedFuture.html" title="struct tower::make::future::SharedFuture">SharedFuture</a>&lt;S&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-ServiceFn%3CT%3E" class="impl"><a class="src rightside" href="../src/tower/util/service_fn.rs.html#66-82">Source</a><a href="#impl-Service%3CRequest%3E-for-ServiceFn%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, F, Request, R, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.ServiceFn.html" title="struct tower::util::ServiceFn">ServiceFn</a>&lt;T&gt;<div class="where">where
T: <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>(Request) -&gt; F,
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;R, E&gt;&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-17" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/service_fn.rs.html#71">Source</a><a href="#associatedtype.Response-17" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = R</h4></section><section id="associatedtype.Error-17" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/service_fn.rs.html#72">Source</a><a href="#associatedtype.Error-17" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-17" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/service_fn.rs.html#73">Source</a><a href="#associatedtype.Future-17" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = F</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CRequest%3E-for-Optional%3CT%3E" class="impl"><a class="src rightside" href="../src/tower/util/optional/mod.rs.html#35-59">Source</a><a href="#impl-Service%3CRequest%3E-for-Optional%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, Request&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt; for <a class="struct" href="util/struct.Optional.html" title="struct tower::util::Optional">Optional</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;Request&gt;,
T::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type tower::Service::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="type" href="type.BoxError.html" title="type tower::BoxError">BoxError</a>&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-18" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/optional/mod.rs.html#40">Source</a><a href="#associatedtype.Response-18" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = &lt;T 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-18" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/optional/mod.rs.html#41">Source</a><a href="#associatedtype.Error-18" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <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.Sync.html" title="trait core::marker::Sync">Sync</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>&gt;</h4></section><section id="associatedtype.Future-18" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/optional/mod.rs.html#42">Source</a><a href="#associatedtype.Future-18" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="util/future/optional/struct.ResponseFuture.html" title="struct tower::util::future::optional::ResponseFuture">ResponseFuture</a>&lt;&lt;T 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.Future" title="type tower::Service::Future">Future</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CT%3E-for-BoxCloneService%3CT,+U,+E%3E" class="impl"><a class="src rightside" href="../src/tower/util/boxed_clone.rs.html#89-103">Source</a><a href="#impl-Service%3CT%3E-for-BoxCloneService%3CT,+U,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;T&gt; for <a class="struct" href="util/struct.BoxCloneService.html" title="struct tower::util::BoxCloneService">BoxCloneService</a>&lt;T, U, E&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Response-19" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone.rs.html#90">Source</a><a href="#associatedtype.Response-19" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = U</h4></section><section id="associatedtype.Error-19" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone.rs.html#91">Source</a><a href="#associatedtype.Error-19" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-19" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone.rs.html#92">Source</a><a href="#associatedtype.Future-19" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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/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;U, E&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CT%3E-for-BoxCloneSyncService%3CT,+U,+E%3E" class="impl"><a class="src rightside" href="../src/tower/util/boxed_clone_sync.rs.html#49-63">Source</a><a href="#impl-Service%3CT%3E-for-BoxCloneSyncService%3CT,+U,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;T&gt; for <a class="struct" href="util/struct.BoxCloneSyncService.html" title="struct tower::util::BoxCloneSyncService">BoxCloneSyncService</a>&lt;T, U, E&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Response-20" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone_sync.rs.html#50">Source</a><a href="#associatedtype.Response-20" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = U</h4></section><section id="associatedtype.Error-20" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone_sync.rs.html#51">Source</a><a href="#associatedtype.Error-20" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-20" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed_clone_sync.rs.html#52">Source</a><a href="#associatedtype.Future-20" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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/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;U, E&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CT%3E-for-BoxService%3CT,+U,+E%3E" class="impl"><a class="src rightside" href="../src/tower/util/boxed/sync.rs.html#86-98">Source</a><a href="#impl-Service%3CT%3E-for-BoxService%3CT,+U,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;T&gt; for <a class="struct" href="util/struct.BoxService.html" title="struct tower::util::BoxService">BoxService</a>&lt;T, U, E&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Response-21" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/sync.rs.html#87">Source</a><a href="#associatedtype.Response-21" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = U</h4></section><section id="associatedtype.Error-21" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/sync.rs.html#88">Source</a><a href="#associatedtype.Error-21" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-21" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/sync.rs.html#89">Source</a><a href="#associatedtype.Future-21" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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/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;U, E&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CT%3E-for-UnsyncBoxService%3CT,+U,+E%3E" class="impl"><a class="src rightside" href="../src/tower/util/boxed/unsync.rs.html#50-62">Source</a><a href="#impl-Service%3CT%3E-for-UnsyncBoxService%3CT,+U,+E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, U, E&gt; <a class="trait" href="trait.Service.html" title="trait tower::Service">Service</a>&lt;T&gt; for <a class="struct" href="util/struct.UnsyncBoxService.html" title="struct tower::util::UnsyncBoxService">UnsyncBoxService</a>&lt;T, U, E&gt;</h3></section></summary><div class="impl-items"><section id="associatedtype.Response-22" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/unsync.rs.html#51">Source</a><a href="#associatedtype.Response-22" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = U</h4></section><section id="associatedtype.Error-22" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/unsync.rs.html#52">Source</a><a href="#associatedtype.Error-22" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = E</h4></section><section id="associatedtype.Future-22" class="associatedtype trait-impl"><a class="src rightside" href="../src/tower/util/boxed/unsync.rs.html#53">Source</a><a href="#associatedtype.Future-22" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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/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;U, E&gt;&gt;&gt;&gt;</h4></section></div></details></div><script src="../trait.impl/tower_service/trait.Service.js" data-ignore-extern-crates="alloc" async></script></section></div></main></body></html>