1
0
mirror of https://github.com/actix/actix-website synced 2024-11-30 19:14:36 +01:00
actix-website/static/api/actix-web/stable/actix_web/trait.FromRequest.html
2018-10-10 08:38:33 -07:00

221 lines
106 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="API documentation for the Rust `FromRequest` trait in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, FromRequest"><title>actix_web::FromRequest - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Trait FromRequest</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Config">Config</a><a href="#associatedtype.Result">Result</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.from_request">from_request</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.extract">extract</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-FromRequest%3CS%3E">Bytes</a><a href="#impl-FromRequest%3CS%3E">String</a><a href="#impl-FromRequest%3CS%3E">Option&lt;T&gt;</a><a href="#impl-FromRequest%3CS%3E">Result&lt;T, Error&gt;</a><a href="#impl-FromRequest%3CS%3E">()</a><a href="#impl-FromRequest%3CS%3E">(A,)</a><a href="#impl-FromRequest%3CS%3E">(A, B)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D, E)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D, E, F)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D, E, F, G)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D, E, F, G, H)</a><a href="#impl-FromRequest%3CS%3E">(A, B, C, D, E, F, G, H, I)</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>actix_web</a></p><script>window.sidebarCurrent = {name: 'FromRequest', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/actix_web/handler.rs.html#42-58' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>actix_web</a>::<wbr><a class="trait" href=''>FromRequest</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait FromRequest&lt;S&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
type <a href='#associatedtype.Config' class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>;
type <a href='#associatedtype.Result' class="type">Result</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="../actix_web/dev/struct.AsyncResult.html" title="struct actix_web::dev::AsyncResult">AsyncResult</a>&lt;Self&gt;&gt;;
fn <a href='#tymethod.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a>;
fn <a href='#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a> { ... }
}</pre></div><div class='docblock'><p>Trait implemented by types that can be extracted from request.</p>
<p>Types that implement this trait can be used with <code>Route::with()</code> method.</p>
</div>
<h2 id='associated-types' class='small-section-header'>
Associated Types<a href='#associated-types' class='anchor'></a>
</h2>
<div class='methods'>
<h3 id='associatedtype.Config' class='method'><span id='Config.t' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a></code></span></h3><div class='docblock'><p>Configuration for conversion process</p>
</div><h3 id='associatedtype.Result' class='method'><span id='Result.t' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="../actix_web/dev/struct.AsyncResult.html" title="struct actix_web::dev::AsyncResult">AsyncResult</a>&lt;Self&gt;&gt;</code></span></h3><div class='docblock'><p>Future that resolves to a Self</p>
</div></div>
<h2 id='required-methods' class='small-section-header'>
Required Methods<a href='#required-methods' class='anchor'></a>
</h2>
<div class='methods'>
<h3 id='tymethod.from_request' class='method'><span id='from_request.v' class='invisible'><code>fn <a href='#tymethod.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></h3><div class='docblock'><p>Convert request to a Self</p>
</div></div>
<h2 id='provided-methods' class='small-section-header'>
Provided Methods<a href='#provided-methods' class='anchor'></a>
</h2>
<div class='methods'>
<h3 id='method.extract' class='method'><span id='extract.v' class='invisible'><code>fn <a href='#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></h3><div class='docblock'><p>Convert request to a Self</p>
<p>This method uses default extractor configuration</p>
</div></div>
<h2 id='foreign-impls' class='small-section-header'>
Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
</h2>
<h3 id='impl-FromRequest%3CS%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S:&nbsp;'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="struct" href="https://docs.rs/bytes/0.4.10/bytes/bytes/struct.Bytes.html" title="struct bytes::bytes::Bytes">Bytes</a></code><a href='#impl-FromRequest%3CS%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#395-406' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Request payload extractor.</p>
<p>Loads request's payload and construct Bytes instance.</p>
<p><a href="dev/struct.PayloadConfig.html"><strong>PayloadConfig</strong></a> allows to configure
extraction process.</p>
<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
<pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">bytes</span>;
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http</span>, <span class="ident">App</span>, <span class="prelude-ty">Result</span>};
<span class="doccomment">/// extract text data from request</span>
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">body</span>: <span class="ident">bytes</span>::<span class="ident">Bytes</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> {
<span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;Body {:?}!&quot;</span>, <span class="ident">body</span>))
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>()
.<span class="ident">resource</span>(<span class="string">&quot;/index.html&quot;</span>, <span class="op">|</span><span class="ident">r</span><span class="op">|</span> <span class="ident">r</span>.<span class="ident">method</span>(<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">GET</span>).<span class="ident">with</span>(<span class="ident">index</span>));
}</pre>
</div><div class='impl-items'><h4 id='associatedtype.Config-1' class="type"><span id='Config.t-1' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="struct" href="../actix_web/dev/struct.PayloadConfig.html" title="struct actix_web::dev::PayloadConfig">PayloadConfig</a></code></span></h4>
<h4 id='associatedtype.Result-1' class="type"><span id='Result.t-1' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = Self, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;</code></span></h4>
<h4 id='method.from_request' class="method"><span id='from_request.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#400-405' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-1' class="method"><span id='extract.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S:&nbsp;'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a href='#impl-FromRequest%3CS%3E-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#435-465' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Extract text information from the request's body.</p>
<p>Text extractor automatically decode body according to the request's charset.</p>
<p><a href="dev/struct.PayloadConfig.html"><strong>PayloadConfig</strong></a> allows to configure
extraction process.</p>
<h2 id="example-1" class="section-header"><a href="#example-1">Example</a></h2>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http</span>, <span class="ident">App</span>, <span class="prelude-ty">Result</span>};
<span class="doccomment">/// extract text data from request</span>
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">body</span>: <span class="ident">String</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> {
<span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;Body {}!&quot;</span>, <span class="ident">body</span>))
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>().<span class="ident">resource</span>(<span class="string">&quot;/index.html&quot;</span>, <span class="op">|</span><span class="ident">r</span><span class="op">|</span> {
<span class="ident">r</span>.<span class="ident">method</span>(<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">GET</span>)
.<span class="ident">with_config</span>(<span class="ident">index</span>, <span class="op">|</span><span class="ident">cfg</span><span class="op">|</span> { <span class="comment">// &lt;- register handler with extractor params</span>
<span class="ident">cfg</span>.<span class="number">0</span>.<span class="ident">limit</span>(<span class="number">4096</span>); <span class="comment">// &lt;- limit size of the payload</span>
})
});
}</pre>
</div><div class='impl-items'><h4 id='associatedtype.Config-2' class="type"><span id='Config.t-2' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="struct" href="../actix_web/dev/struct.PayloadConfig.html" title="struct actix_web::dev::PayloadConfig">PayloadConfig</a></code></span></h4>
<h4 id='associatedtype.Result-2' class="type"><span id='Result.t-2' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;</code></span></h4>
<h4 id='method.from_request-1' class="method"><span id='from_request.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#440-464' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-2' class="method"><span id='extract.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-2' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T:&nbsp;'static, S:&nbsp;'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt;,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-2' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#513-527' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Optionally extract a field from the request</p>
<p>If the FromRequest for T fails, return None rather than returning an error response</p>
<h2 id="example-2" class="section-header"><a href="#example-2">Example</a></h2>
<pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">rand</span>;
<span class="attribute">#[<span class="ident">macro_use</span>]</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde_derive</span>;
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http</span>, <span class="ident">App</span>, <span class="prelude-ty">Result</span>, <span class="ident">HttpRequest</span>, <span class="ident">Error</span>, <span class="ident">FromRequest</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">error</span>::<span class="ident">ErrorBadRequest</span>;
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Deserialize</span>)]</span>
<span class="kw">struct</span> <span class="ident">Thing</span> { <span class="ident">name</span>: <span class="ident">String</span> }
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span> <span class="ident">FromRequest</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">Thing</span> {
<span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> ();
<span class="kw">type</span> <span class="prelude-ty">Result</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Thing</span>, <span class="ident">Error</span><span class="op">&gt;</span>;
<span class="attribute">#[<span class="ident">inline</span>]</span>
<span class="kw">fn</span> <span class="ident">from_request</span>(<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">HttpRequest</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span>, <span class="ident">_cfg</span>: <span class="kw-2">&amp;</span><span class="self">Self</span>::<span class="ident">Config</span>) <span class="op">-&gt;</span> <span class="self">Self</span>::<span class="prelude-ty">Result</span> {
<span class="kw">if</span> <span class="ident">rand</span>::<span class="ident">random</span>() {
<span class="prelude-val">Ok</span>(<span class="ident">Thing</span> { <span class="ident">name</span>: <span class="string">&quot;thingy&quot;</span>.<span class="ident">into</span>() })
} <span class="kw">else</span> {
<span class="prelude-val">Err</span>(<span class="ident">ErrorBadRequest</span>(<span class="string">&quot;no luck&quot;</span>))
}
}
}
<span class="doccomment">/// extract text data from request</span>
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">supplied_thing</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Thing</span><span class="op">&gt;</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="ident">supplied_thing</span> {
<span class="comment">// Puns not intended</span>
<span class="prelude-val">Some</span>(<span class="ident">thing</span>) <span class="op">=&gt;</span> <span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;Got something: {:?}&quot;</span>, <span class="ident">thing</span>)),
<span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;No thing!&quot;</span>))
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>().<span class="ident">resource</span>(<span class="string">&quot;/users/:first&quot;</span>, <span class="op">|</span><span class="ident">r</span><span class="op">|</span> {
<span class="ident">r</span>.<span class="ident">method</span>(<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">POST</span>).<span class="ident">with</span>(<span class="ident">index</span>)
});
}</pre>
</div><div class='impl-items'><h4 id='associatedtype.Config-3' class="type"><span id='Config.t-3' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = T::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a></code></span></h4>
<h4 id='associatedtype.Result-3' class="type"><span id='Result.t-3' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-2' class="method"><span id='from_request.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#521-526' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-3' class="method"><span id='extract.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-3' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T:&nbsp;'static, S:&nbsp;'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt;,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-3' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#574-585' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Optionally extract a field from the request or extract the Error if unsuccessful</p>
<p>If the FromRequest for T fails, inject Err into handler rather than returning an error response</p>
<h2 id="example-3" class="section-header"><a href="#example-3">Example</a></h2>
<pre class="rust rust-example-rendered">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">rand</span>;
<span class="attribute">#[<span class="ident">macro_use</span>]</span> <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">serde_derive</span>;
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http</span>, <span class="ident">App</span>, <span class="prelude-ty">Result</span>, <span class="ident">HttpRequest</span>, <span class="ident">Error</span>, <span class="ident">FromRequest</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">error</span>::<span class="ident">ErrorBadRequest</span>;
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Deserialize</span>)]</span>
<span class="kw">struct</span> <span class="ident">Thing</span> { <span class="ident">name</span>: <span class="ident">String</span> }
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span> <span class="ident">FromRequest</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">Thing</span> {
<span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> ();
<span class="kw">type</span> <span class="prelude-ty">Result</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Thing</span>, <span class="ident">Error</span><span class="op">&gt;</span>;
<span class="attribute">#[<span class="ident">inline</span>]</span>
<span class="kw">fn</span> <span class="ident">from_request</span>(<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">HttpRequest</span><span class="op">&lt;</span><span class="ident">S</span><span class="op">&gt;</span>, <span class="ident">_cfg</span>: <span class="kw-2">&amp;</span><span class="self">Self</span>::<span class="ident">Config</span>) <span class="op">-&gt;</span> <span class="self">Self</span>::<span class="prelude-ty">Result</span> {
<span class="kw">if</span> <span class="ident">rand</span>::<span class="ident">random</span>() {
<span class="prelude-val">Ok</span>(<span class="ident">Thing</span> { <span class="ident">name</span>: <span class="string">&quot;thingy&quot;</span>.<span class="ident">into</span>() })
} <span class="kw">else</span> {
<span class="prelude-val">Err</span>(<span class="ident">ErrorBadRequest</span>(<span class="string">&quot;no luck&quot;</span>))
}
}
}
<span class="doccomment">/// extract text data from request</span>
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">supplied_thing</span>: <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Thing</span><span class="op">&gt;</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="ident">supplied_thing</span> {
<span class="prelude-val">Ok</span>(<span class="ident">thing</span>) <span class="op">=&gt;</span> <span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;Got thing: {:?}&quot;</span>, <span class="ident">thing</span>)),
<span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> <span class="prelude-val">Ok</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;Error extracting thing: {}&quot;</span>, <span class="ident">e</span>))
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>().<span class="ident">resource</span>(<span class="string">&quot;/users/:first&quot;</span>, <span class="op">|</span><span class="ident">r</span><span class="op">|</span> {
<span class="ident">r</span>.<span class="ident">method</span>(<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">POST</span>).<span class="ident">with</span>(<span class="ident">index</span>)
});
}</pre>
</div><div class='impl-items'><h4 id='associatedtype.Config-4' class="type"><span id='Config.t-4' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = T::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a></code></span></h4>
<h4 id='associatedtype.Result-4' class="type"><span id='Result.t-4' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-3' class="method"><span id='from_request.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#582-584' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-4' class="method"><span id='extract.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-4' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code><a href='#impl-FromRequest%3CS%3E-4' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#699-703' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-5' class="type"><span id='Config.t-5' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-5' class="type"><span id='Result.t-5' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = Self</code></span></h4>
<h4 id='method.from_request-4' class="method"><span id='from_request.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(_req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#702' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-5' class="method"><span id='extract.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-5' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">,)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-5' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-6' class="type"><span id='Config.t-6' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">,)</a></code></span></h4>
<h4 id='associatedtype.Result-6' class="type"><span id='Result.t-6' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">,)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-5' class="method"><span id='from_request.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-6' class="method"><span id='extract.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-6' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-6' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-7' class="type"><span id='Config.t-7' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-7' class="type"><span id='Result.t-7' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-6' class="method"><span id='from_request.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-7' class="method"><span id='extract.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-7' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-7' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-8' class="type"><span id='Config.t-8' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-8' class="type"><span id='Result.t-8' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-7' class="method"><span id='from_request.v-8' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-8' class="method"><span id='extract.v-8' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-8' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-8' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-9' class="type"><span id='Config.t-9' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-9' class="type"><span id='Result.t-9' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-8' class="method"><span id='from_request.v-9' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-9' class="method"><span id='extract.v-9' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-9' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, E:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-9' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-10' class="type"><span id='Config.t-10' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, E::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-10' class="type"><span id='Result.t-10' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-9' class="method"><span id='from_request.v-10' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-10' class="method"><span id='extract.v-10' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-10' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, E:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, F:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-10' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-11' class="type"><span id='Config.t-11' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, E::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, F::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-11' class="type"><span id='Result.t-11' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-10' class="method"><span id='from_request.v-11' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-11' class="method"><span id='extract.v-11' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-11' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, E:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, F:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, G:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-11' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-12' class="type"><span id='Config.t-12' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, E::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, F::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, G::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-12' class="type"><span id='Result.t-12' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-11' class="method"><span id='from_request.v-12' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-12' class="method"><span id='extract.v-12' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-12' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, E:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, F:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, G:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, H:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G, H<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-12' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-13' class="type"><span id='Config.t-13' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, E::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, F::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, G::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, H::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-13' class="type"><span id='Result.t-13' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G, H<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-12' class="method"><span id='from_request.v-13' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-13' class="method"><span id='extract.v-13' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-13' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S, A:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, B:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, C:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, D:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, E:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, F:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, G:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, H:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static, I:&nbsp;<a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; + 'static&gt; <a class="trait" href="../actix_web/trait.FromRequest.html" title="trait actix_web::FromRequest">FromRequest</a>&lt;S&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G, H, I<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-13' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#640-654' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>FromRequest implementation for tuple</p>
</div><div class='impl-items'><h4 id='associatedtype.Config-14' class="type"><span id='Config.t-14' class='invisible'><code>type <a href='#associatedtype.Config' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, B::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, C::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, D::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, E::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, F::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, G::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, H::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>, I::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
<h4 id='associatedtype.Result-14' class="type"><span id='Result.t-14' class='invisible'><code>type <a href='#associatedtype.Result' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B, C, D, E, F, G, H, I<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-13' class="method"><span id='from_request.v-14' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#647-653' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-14' class="method"><span id='extract.v-14' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-FromRequest%3CS%3E-14' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/middleware/session/struct.Session.html" title="struct actix_web::middleware::session::Session">Session</a></code><a href='#impl-FromRequest%3CS%3E-14' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/middleware/session.rs.html#212-220' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Extractor implementation for Session type.</p>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">middleware</span>::<span class="ident">session</span>::<span class="ident">Session</span>;
<span class="kw">fn</span> <span class="ident">index</span>(<span class="ident">session</span>: <span class="ident">Session</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span><span class="op">&gt;</span> {
<span class="comment">// access session data</span>
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">count</span>) <span class="op">=</span> <span class="ident">session</span>.<span class="ident">get</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>(<span class="string">&quot;counter&quot;</span>)<span class="question-mark">?</span> {
<span class="ident">session</span>.<span class="ident">set</span>(<span class="string">&quot;counter&quot;</span>, <span class="ident">count</span> <span class="op">+</span> <span class="number">1</span>)<span class="question-mark">?</span>;
} <span class="kw">else</span> {
<span class="ident">session</span>.<span class="ident">set</span>(<span class="string">&quot;counter&quot;</span>, <span class="number">1</span>)<span class="question-mark">?</span>;
}
<span class="prelude-val">Ok</span>(<span class="string">&quot;Welcome!&quot;</span>)
}</pre>
</div><div class='impl-items'><h4 id='associatedtype.Config-15' class="type"><span id='Config.t-15' class='invisible'><code>type <a href='#associatedtype.Config-15' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-15' class="type"><span id='Result.t-15' class='invisible'><code>type <a href='#associatedtype.Result-15' class="type">Result</a> = <a class="struct" href="../actix_web/middleware/session/struct.Session.html" title="struct actix_web::middleware::session::Session">Session</a></code></span></h4>
<h4 id='method.from_request-14' class="method"><span id='from_request.v-15' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-14' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/middleware/session.rs.html#217-219' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-15' class="method"><span id='extract.v-15' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-15' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;</code><a href='#impl-FromRequest%3CS%3E-15' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/httprequest.rs.html#345-353' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-16' class="type"><span id='Config.t-16' class='invisible'><code>type <a href='#associatedtype.Config-16' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-16' class="type"><span id='Result.t-16' class='invisible'><code>type <a href='#associatedtype.Result-16' class="type">Result</a> = Self</code></span></h4>
<h4 id='method.from_request-15' class="method"><span id='from_request.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-15' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/httprequest.rs.html#350-352' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-16' class="method"><span id='extract.v-16' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-16' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.State.html" title="struct actix_web::State">State</a>&lt;S&gt;</code><a href='#impl-FromRequest%3CS%3E-16' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#554-562' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-17' class="type"><span id='Config.t-17' class='invisible'><code>type <a href='#associatedtype.Config-17' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-17' class="type"><span id='Result.t-17' class='invisible'><code>type <a href='#associatedtype.Result-17' class="type">Result</a> = <a class="struct" href="../actix_web/struct.State.html" title="struct actix_web::State">State</a>&lt;S&gt;</code></span></h4>
<h4 id='method.from_request-16' class="method"><span id='from_request.v-17' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-16' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#559-561' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-17' class="method"><span id='extract.v-17' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-17' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.Form.html" title="struct actix_web::Form">Form</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://docs.rs/serde/1.0.79/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-17' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#278-297' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-18' class="type"><span id='Config.t-18' class='invisible'><code>type <a href='#associatedtype.Config-18' class="type">Config</a> = <a class="struct" href="../actix_web/dev/struct.FormConfig.html" title="struct actix_web::dev::FormConfig">FormConfig</a>&lt;S&gt;</code></span></h4>
<h4 id='associatedtype.Result-18' class="type"><span id='Result.t-18' class='invisible'><code>type <a href='#associatedtype.Result-18' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = Self, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-17' class="method"><span id='from_request.v-18' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-17' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#287-296' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-18' class="method"><span id='extract.v-18' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-18' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.Json.html" title="struct actix_web::Json">Json</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://docs.rs/serde/1.0.79/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'static,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-18' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/json.rs.html#133-152' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-19' class="type"><span id='Config.t-19' class='invisible'><code>type <a href='#associatedtype.Config-19' class="type">Config</a> = <a class="struct" href="../actix_web/dev/struct.JsonConfig.html" title="struct actix_web::dev::JsonConfig">JsonConfig</a>&lt;S&gt;</code></span></h4>
<h4 id='associatedtype.Result-19' class="type"><span id='Result.t-19' class='invisible'><code>type <a href='#associatedtype.Result-19' class="type">Result</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;<a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.Future.html" title="trait futures::future::Future">Future</a>&lt;Item = Self, Error = <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;&gt;</code></span></h4>
<h4 id='method.from_request-18' class="method"><span id='from_request.v-19' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-18' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, cfg: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/json.rs.html#142-151' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-19' class="method"><span id='extract.v-19' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-19' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.Path.html" title="struct actix_web::Path">Path</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://docs.rs/serde/1.0.79/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-19' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#110-124' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-20' class="type"><span id='Config.t-20' class='invisible'><code>type <a href='#associatedtype.Config-20' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-20' class="type"><span id='Result.t-20' class='invisible'><code>type <a href='#associatedtype.Result-20' class="type">Result</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;</code></span></h4>
<h4 id='method.from_request-19' class="method"><span id='from_request.v-20' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-19' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#118-123' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-20' class="method"><span id='extract.v-20' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h3 id='impl-FromRequest%3CS%3E-20' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T, S&gt; FromRequest&lt;S&gt; for <a class="struct" href="../actix_web/struct.Query.html" title="struct actix_web::Query">Query</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://docs.rs/serde/1.0.79/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>,&nbsp;</span></code><a href='#impl-FromRequest%3CS%3E-20' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#199-212' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Config-21' class="type"><span id='Config.t-21' class='invisible'><code>type <a href='#associatedtype.Config-21' class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></span></h4>
<h4 id='associatedtype.Result-21' class="type"><span id='Result.t-21' class='invisible'><code>type <a href='#associatedtype.Result-21' class="type">Result</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="struct" href="../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>&gt;</code></span></h4>
<h4 id='method.from_request-20' class="method"><span id='from_request.v-21' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.from_request-20' class='fnname'>from_request</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;, _: &amp;Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Config" title="type actix_web::FromRequest::Config">Config</a>) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/extractor.rs.html#207-211' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.extract-21' class="method"><span id='extract.v-21' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../actix_web/trait.FromRequest.html#method.extract' class='fnname'>extract</a>(req: &amp;<a class="struct" href="../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a>&lt;S&gt;) -&gt; Self::<a class="type" href="../actix_web/trait.FromRequest.html#associatedtype.Result" title="type actix_web::FromRequest::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/actix_web/handler.rs.html#55-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></div><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
src="../implementors/actix_web/trait.FromRequest.js">
</script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "actix_web";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>