mirror of
https://github.com/fafhrd91/actix-net
synced 2025-01-19 02:41:49 +01:00
71 lines
34 KiB
HTML
71 lines
34 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An asynchronous operation from `Request` to a `Response`."><title>Service in actix_service - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-b778ab399e080a4b.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_service" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0-nightly (7608018cb 2024-09-29)" data-channel="nightly" data-search-js="search-e056c65ede92db13.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-54bc299d2a5e4e43.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../actix_service/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../actix_service/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../actix_service/index.html">actix_<wbr>service</a><span class="version">2.0.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">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.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%3CReq%3E-for-%26S" title="&'a S">&'a S</a></li><li><a href="#impl-Service%3CReq%3E-for-%26mut+S" title="&'a mut S">&'a mut S</a></li><li><a href="#impl-Service%3CReq%3E-for-Box%3CS%3E" title="Box<S>">Box<S></a></li><li><a href="#impl-Service%3CReq%3E-for-Rc%3CS%3E" title="Rc<S>">Rc<S></a></li><li><a href="#impl-Service%3CReq%3E-for-RefCell%3CS%3E" title="RefCell<S>">RefCell<S></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 actix_<wbr>service</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">actix_service</a></span><h1>Trait <span class="trait">Service</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/actix_service/lib.rs.html#94-127">source</a> </span></div><pre class="rust item-decl"><code>pub trait Service<Req> {
|
|
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/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>>;
|
|
|
|
// Required methods
|
|
fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.call" class="fn">call</a>(&self, req: Req) -> Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::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 operation from <code>Request</code> to a <code>Response</code>.</p>
|
|
<p>The <code>Service</code> trait models a request/response interaction, receiving requests and returning
|
|
replies. You can think about a service as a function with one argument that returns some result
|
|
asynchronously. Conceptually, the operation looks like this:</p>
|
|
|
|
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">async fn</span>(Request) -> <span class="prelude-ty">Result</span><Response, <span class="prelude-val">Err</span>></code></pre></div>
|
|
<p>The <code>Service</code> trait just generalizes this form. Requests are defined as a generic type parameter
|
|
and responses and other details are defined as associated types on the trait impl. Notice that
|
|
this design means that services can receive many request types and converge them to a single
|
|
response type.</p>
|
|
<p>Services can also have mutable state that influence computation by using a <code>Cell</code>, <code>RefCell</code>
|
|
or <code>Mutex</code>. Services intentionally do not take <code>&mut self</code> to reduce overhead in the
|
|
common cases.</p>
|
|
<p><code>Service</code> provides a symmetric and uniform API; the same abstractions can be used to represent
|
|
both clients and servers. Services describe only <em>transformation</em> operations which encourage
|
|
simple API surfaces. This leads to simpler design of each service, improves test-ability and
|
|
makes composition easier.</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">struct </span>MyService;
|
|
|
|
<span class="kw">impl </span>Service<u8> <span class="kw">for </span>MyService {
|
|
<span class="kw">type </span>Response = u64;
|
|
<span class="kw">type </span>Error = MyError;
|
|
<span class="kw">type </span>Future = Pin<Box<<span class="kw">dyn </span>Future<Output = <span class="prelude-ty">Result</span><<span class="self">Self</span>::Response, <span class="self">Self</span>::Error>>>>;
|
|
|
|
<span class="kw">fn </span>poll_ready(<span class="kw-2">&</span><span class="self">self</span>, cx: <span class="kw-2">&mut </span>Context<<span class="lifetime">'_</span>>) -> Poll<<span class="prelude-ty">Result</span><(), <span class="self">Self</span>::Error>> { ... }
|
|
|
|
<span class="kw">fn </span>call(<span class="kw-2">&</span><span class="self">self</span>, req: u8) -> <span class="self">Self</span>::Future { ... }
|
|
}</code></pre></div>
|
|
<p>Sometimes it is not necessary to implement the Service trait. For example, the above service
|
|
could be rewritten as a simple function and passed to <a href="fn.fn_service.html" title="fn actix_service::fn_service"><code>fn_service</code></a>.</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">async fn </span>my_service(req: u8) -> <span class="prelude-ty">Result</span><u64, MyError>;
|
|
|
|
<span class="kw">let </span>svc = fn_service(my_service)
|
|
svc.call(<span class="number">123</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/actix_service/lib.rs.html#96">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/actix_service/lib.rs.html#99">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 when polling readiness or executing call.</p>
|
|
</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../src/actix_service/lib.rs.html#102">source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></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/actix_service/lib.rs.html#116">source</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section></summary><div class="docblock"><p>Returns <code>Ready</code> when the service is able to process requests.</p>
|
|
<p>If the service is at capacity, then <code>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.</p>
|
|
<p>This is a best effort implementation. False positives are permitted. It is permitted for
|
|
the service to return <code>Ready</code> from a <code>poll_ready</code> call and the next invocation of <code>call</code>
|
|
results in an error.</p>
|
|
<h5 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h5>
|
|
<ol>
|
|
<li><code>poll_ready</code> might be called on a different task to <code>call</code>.</li>
|
|
<li>In cases of chained services, <code>.poll_ready()</code> is called for all services at once.</li>
|
|
</ol>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.call" class="method"><a class="src rightside" href="../src/actix_service/lib.rs.html#126">source</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, req: Req) -> Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::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 of <code>call</code> should
|
|
take care to not call <code>poll_ready</code>. If the service is at capacity and the request is unable
|
|
to be handled, the returned <code>Future</code> should resolve to an error.</p>
|
|
<p>Invoking <code>call</code> without first invoking <code>poll_ready</code> is permitted. Implementations must be
|
|
resilient to this fact.</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%3CReq%3E-for-%26S" class="impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#181-196">source</a><a href="#impl-Service%3CReq%3E-for-%26S" class="anchor">§</a><h3 class="code-header">impl<'a, S, Req> <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a S</a><div class="where">where
|
|
S: <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> + 'a,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#185">source</a><a href="#associatedtype.Response-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a></h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#186">source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#187">source</a><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section><section id="method.poll_ready" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#189-191">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>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section><section id="method.call" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#193-195">source</a><a href="#method.call" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, request: Req) -> S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CReq%3E-for-%26mut+S" class="impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#164-179">source</a><a href="#impl-Service%3CReq%3E-for-%26mut+S" class="anchor">§</a><h3 class="code-header">impl<'a, S, Req> <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut S</a><div class="where">where
|
|
S: <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> + 'a,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#168">source</a><a href="#associatedtype.Response-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a></h4></section><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#169">source</a><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#170">source</a><a href="#associatedtype.Future-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section><section id="method.poll_ready-1" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#172-174">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>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section><section id="method.call-1" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#176-178">source</a><a href="#method.call-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, request: Req) -> S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CReq%3E-for-Box%3CS%3E" class="impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#198-213">source</a><a href="#impl-Service%3CReq%3E-for-Box%3CS%3E" class="anchor">§</a><h3 class="code-header">impl<S, Req> <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><S><div class="where">where
|
|
S: <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#202">source</a><a href="#associatedtype.Response-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a></h4></section><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#203">source</a><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#204">source</a><a href="#associatedtype.Future-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section><section id="method.poll_ready-2" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#206-208">source</a><a href="#method.poll_ready-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, S::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section><section id="method.call-2" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#210-212">source</a><a href="#method.call-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, request: Req) -> S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CReq%3E-for-Rc%3CS%3E" class="impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#215-230">source</a><a href="#impl-Service%3CReq%3E-for-Rc%3CS%3E" class="anchor">§</a><h3 class="code-header">impl<S, Req> <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html" title="struct alloc::rc::Rc">Rc</a><S><div class="where">where
|
|
S: <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Response-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#219">source</a><a href="#associatedtype.Response-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a></h4></section><section id="associatedtype.Error-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#220">source</a><a href="#associatedtype.Error-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-4" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#221">source</a><a href="#associatedtype.Future-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section><section id="method.poll_ready-3" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#223-225">source</a><a href="#method.poll_ready-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section><section id="method.call-3" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#227-229">source</a><a href="#method.call-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, request: Req) -> S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Service%3CReq%3E-for-RefCell%3CS%3E" class="impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#233-248">source</a><a href="#impl-Service%3CReq%3E-for-RefCell%3CS%3E" class="anchor">§</a><h3 class="code-header">impl<S, Req> <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req> for <a class="struct" href="https://doc.rust-lang.org/nightly/core/cell/struct.RefCell.html" title="struct core::cell::RefCell">RefCell</a><S><div class="where">where
|
|
S: <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>,</div></h3></section></summary><div class="docblock"><p>This impl is deprecated since v2 because the <code>Service</code> trait now receives shared reference.</p>
|
|
</div><div class="impl-items"><section id="associatedtype.Response-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#237">source</a><a href="#associatedtype.Response-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Response" class="associatedtype">Response</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Response" title="type actix_service::Service::Response">Response</a></h4></section><section id="associatedtype.Error-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#238">source</a><a href="#associatedtype.Error-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a></h4></section><section id="associatedtype.Future-5" class="associatedtype trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#239">source</a><a href="#associatedtype.Future-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <S as <a class="trait" href="trait.Service.html" title="trait actix_service::Service">Service</a><Req>>::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::Service::Future">Future</a></h4></section><section id="method.poll_ready-4" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#241-243">source</a><a href="#method.poll_ready-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.poll_ready" class="fn">poll_ready</a>(&self, ctx: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Service.html#associatedtype.Error" title="type actix_service::Service::Error">Error</a>>></h4></section><section id="method.call-4" class="method trait-impl"><a class="src rightside" href="../src/actix_service/lib.rs.html#245-247">source</a><a href="#method.call-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.call" class="fn">call</a>(&self, request: Req) -> S::<a class="associatedtype" href="trait.Service.html#associatedtype.Future" title="type actix_service::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"></div><script src="../trait.impl/actix_service/trait.Service.js" data-ignore-extern-crates="alloc,core" async></script></section></div></main></body></html> |