1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 16:52:58 +01:00
actix-net/actix_service/trait.ServiceFactoryExt.html
2024-10-01 00:01:00 +00:00

37 lines
14 KiB
HTML
Raw Permalink 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 extension trait for `ServiceFactory`s that provides a variety of convenient adapters."><title>ServiceFactoryExt 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<wbr>Factory<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.and_then" title="and_then">and_then</a></li><li><a href="#method.map" title="map">map</a></li><li><a href="#method.map_err" title="map_err">map_err</a></li><li><a href="#method.map_init_err" title="map_init_err">map_init_err</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">ServiceFactoryExt</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/ext.rs.html#64-108">source</a> </span></div><pre class="rust item-decl"><code>pub trait ServiceFactoryExt&lt;Req&gt;: <a class="trait" href="trait.ServiceFactory.html" title="trait actix_service::ServiceFactory">ServiceFactory</a>&lt;Req&gt; {
// Provided methods
fn <a href="#method.map" class="fn">map</a>&lt;F, R&gt;(self, f: F) -&gt; MapServiceFactory&lt;Self, F, Req, R&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>) -&gt; R + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_err" class="fn">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; MapErrServiceFactory&lt;Self, Req, F, E&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Error" title="type actix_service::ServiceFactory::Error">Error</a>) -&gt; E + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.map_init_err" class="fn">map_init_err</a>&lt;F, E&gt;(self, f: F) -&gt; MapInitErr&lt;Self, F, Req, E&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.InitError" title="type actix_service::ServiceFactory::InitError">InitError</a>) -&gt; E + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.and_then" class="fn">and_then</a>&lt;I, SF1&gt;(
self,
factory: I,
) -&gt; AndThenServiceFactory&lt;Self, SF1, Req&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Config" title="type actix_service::ServiceFactory::Config">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
I: <a class="trait" href="trait.IntoServiceFactory.html" title="trait actix_service::IntoServiceFactory">IntoServiceFactory</a>&lt;SF1, Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>&gt;,
SF1: <a class="trait" href="trait.ServiceFactory.html" title="trait actix_service::ServiceFactory">ServiceFactory</a>&lt;Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>, Config = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Config" title="type actix_service::ServiceFactory::Config">Config</a>, Error = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Error" title="type actix_service::ServiceFactory::Error">Error</a>, InitError = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.InitError" title="type actix_service::ServiceFactory::InitError">InitError</a>&gt;</span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An extension trait for <a href="trait.ServiceFactory.html" title="trait actix_service::ServiceFactory"><code>ServiceFactory</code></a>s that provides a variety of convenient adapters.</p>
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.map" class="method"><a class="src rightside" href="../src/actix_service/ext.rs.html#67-73">source</a><h4 class="code-header">fn <a href="#method.map" class="fn">map</a>&lt;F, R&gt;(self, f: F) -&gt; MapServiceFactory&lt;Self, F, Req, R&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>) -&gt; R + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Map this services output to a different type, returning a new service
of the resulting type.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.map_err" class="method"><a class="src rightside" href="../src/actix_service/ext.rs.html#76-82">source</a><h4 class="code-header">fn <a href="#method.map_err" class="fn">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; MapErrServiceFactory&lt;Self, Req, F, E&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Error" title="type actix_service::ServiceFactory::Error">Error</a>) -&gt; E + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Map this services error to a different error, returning a new service.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.map_init_err" class="method"><a class="src rightside" href="../src/actix_service/ext.rs.html#85-91">source</a><h4 class="code-header">fn <a href="#method.map_init_err" class="fn">map_init_err</a>&lt;F, E&gt;(self, f: F) -&gt; MapInitErr&lt;Self, F, Req, E&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.InitError" title="type actix_service::ServiceFactory::InitError">InitError</a>) -&gt; E + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Map this factorys init error to a different error, returning a new service.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.and_then" class="method"><a class="src rightside" href="../src/actix_service/ext.rs.html#94-107">source</a><h4 class="code-header">fn <a href="#method.and_then" class="fn">and_then</a>&lt;I, SF1&gt;(self, factory: I) -&gt; AndThenServiceFactory&lt;Self, SF1, Req&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Config" title="type actix_service::ServiceFactory::Config">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
I: <a class="trait" href="trait.IntoServiceFactory.html" title="trait actix_service::IntoServiceFactory">IntoServiceFactory</a>&lt;SF1, Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>&gt;,
SF1: <a class="trait" href="trait.ServiceFactory.html" title="trait actix_service::ServiceFactory">ServiceFactory</a>&lt;Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Response" title="type actix_service::ServiceFactory::Response">Response</a>, Config = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Config" title="type actix_service::ServiceFactory::Config">Config</a>, Error = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.Error" title="type actix_service::ServiceFactory::Error">Error</a>, InitError = Self::<a class="associatedtype" href="trait.ServiceFactory.html#associatedtype.InitError" title="type actix_service::ServiceFactory::InitError">InitError</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Call another service after call to this one has resolved successfully.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-ServiceFactoryExt%3CReq%3E-for-SF" class="impl"><a class="src rightside" href="../src/actix_service/ext.rs.html#110">source</a><a href="#impl-ServiceFactoryExt%3CReq%3E-for-SF" class="anchor">§</a><h3 class="code-header">impl&lt;SF, Req&gt; <a class="trait" href="trait.ServiceFactoryExt.html" title="trait actix_service::ServiceFactoryExt">ServiceFactoryExt</a>&lt;Req&gt; for SF<div class="where">where
SF: <a class="trait" href="trait.ServiceFactory.html" title="trait actix_service::ServiceFactory">ServiceFactory</a>&lt;Req&gt;,</div></h3></section></div><script src="../trait.impl/actix_service/ext/trait.ServiceFactoryExt.js" async></script></section></div></main></body></html>