1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-01-22 23:05:56 +01:00

Deploying to gh-pages from @ e10937103e009cd682401ef077e2413e332af5b9 🚀

This commit is contained in:
robjtede 2021-08-30 22:30:19 +00:00
parent dccf03e6ef
commit 0c14dfbe8c
37 changed files with 184 additions and 352 deletions

File diff suppressed because one or more lines are too long

View File

@ -20,12 +20,12 @@ server will fail to start up or serve requests.</p>
.<span class="ident">max_age</span>(<span class="number">3600</span>); .<span class="ident">max_age</span>(<span class="number">3600</span>);
<span class="comment">// `cors` can now be used in `App::wrap`.</span></code></pre></div> <span class="comment">// `cors` can now be used in `App::wrap`.</span></code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#77-451" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.permissive" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#82-106" title="goto source code">[src]</a></div><a href="#method.permissive" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.permissive" class="fnname">permissive</a>() -&gt; Self</h4></div></summary><div class="docblock"><p>A very permissive set of default for quick development. Not recommended for production use.</p> </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#77-447" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.permissive" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#82-106" title="goto source code">[src]</a></div><a href="#method.permissive" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.permissive" class="fnname">permissive</a>() -&gt; Self</h4></div></summary><div class="docblock"><p>A very permissive set of default for quick development. Not recommended for production use.</p>
<p><em>All</em> origins, methods, request headers and exposed headers allowed. Credentials supported. <p><em>All</em> origins, methods, request headers and exposed headers allowed. Credentials supported.
Max age 1 hour. Does not send wildcard.</p> Max age 1 hour. Does not send wildcard.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_origin" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#111-117" title="goto source code">[src]</a></div><a href="#method.allow_any_origin" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_origin" class="fnname">allow_any_origin</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed origin list to a state where any origin is accepted.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_origin" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#111-117" title="goto source code">[src]</a></div><a href="#method.allow_any_origin" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_origin" class="fnname">allow_any_origin</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed origin list to a state where any origin is accepted.</p>
<p>See <a href="struct.Cors.html#method.allowed_origin" title="Cors::allowed_origin"><code>Cors::allowed_origin</code></a> for more info on allowed origins.</p> <p>See <a href="struct.Cors.html#method.allowed_origin" title="Cors::allowed_origin"><code>Cors::allowed_origin</code></a> for more info on allowed origins.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_origin" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#143-171" title="goto source code">[src]</a></div><a href="#method.allowed_origin" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_origin" class="fnname">allowed_origin</a>(self, origin: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Add an origin that is allowed to make requests.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_origin" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#143-170" title="goto source code">[src]</a></div><a href="#method.allowed_origin" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_origin" class="fnname">allowed_origin</a>(self, origin: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Add an origin that is allowed to make requests.</p>
<p>By default, requests from all origins are accepted by CORS logic. This method allows to <p>By default, requests from all origins are accepted by CORS logic. This method allows to
specify a finite set of origins to verify the value of the <code>Origin</code> request header.</p> specify a finite set of origins to verify the value of the <code>Origin</code> request header.</p>
<p>These are <code>origin-or-null</code> types in the <a href="https://fetch.spec.whatwg.org/#origin-header">Fetch Standard</a>.</p> <p>These are <code>origin-or-null</code> types in the <a href="https://fetch.spec.whatwg.org/#origin-header">Fetch Standard</a>.</p>
@ -43,39 +43,39 @@ allowed origins.</p>
<li>If supplied origin is not valid uri</li> <li>If supplied origin is not valid uri</li>
<li>If supplied origin is a wildcard (<code>*</code>). <a href="struct.Cors.html#method.send_wildcard" title="Cors::send_wildcard"><code>Cors::send_wildcard</code></a> should be used instead.</li> <li>If supplied origin is a wildcard (<code>*</code>). <a href="struct.Cors.html#method.send_wildcard" title="Cors::send_wildcard"><code>Cors::send_wildcard</code></a> should be used instead.</li>
</ul> </ul>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_origin_fn" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#181-192" title="goto source code">[src]</a></div><a href="#method.allowed_origin_fn" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_origin_fn" class="fnname">allowed_origin_fn</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/value/struct.HeaderValue.html" title="struct http::header::value::HeaderValue">HeaderValue</a>, &amp;RequestHead) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> + 'static,&nbsp;</span></h4></div></summary><div class="docblock"><p>Determinate allowed origins by processing requests which didnt match any origins specified </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_origin_fn" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#180-191" title="goto source code">[src]</a></div><a href="#method.allowed_origin_fn" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_origin_fn" class="fnname">allowed_origin_fn</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/value/struct.HeaderValue.html" title="struct http::header::value::HeaderValue">HeaderValue</a>, &amp;RequestHead) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> + 'static,&nbsp;</span></h4></div></summary><div class="docblock"><p>Determinate allowed origins by processing requests which didnt match any origins specified
in the <code>allowed_origin</code>.</p> in the <code>allowed_origin</code>.</p>
<p>The function will receive two parameters, the Origin header value, and the <code>RequestHead</code> of <p>The function will receive two parameters, the Origin header value, and the <code>RequestHead</code> of
each request, which can be used to determine whether to allow the request or not.</p> each request, which can be used to determine whether to allow the request or not.</p>
<p>If the function returns <code>true</code>, the clients <code>Origin</code> request header will be echoed back <p>If the function returns <code>true</code>, the clients <code>Origin</code> request header will be echoed back
into the <code>Access-Control-Allow-Origin</code> response header.</p> into the <code>Access-Control-Allow-Origin</code> response header.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_method" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#197-203" title="goto source code">[src]</a></div><a href="#method.allow_any_method" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_method" class="fnname">allow_any_method</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed methods list to all methods.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_method" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#196-202" title="goto source code">[src]</a></div><a href="#method.allow_any_method" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_method" class="fnname">allow_any_method</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed methods list to all methods.</p>
<p>See <a href="struct.Cors.html#method.allowed_methods" title="Cors::allowed_methods"><code>Cors::allowed_methods</code></a> for more info on allowed methods.</p> <p>See <a href="struct.Cors.html#method.allowed_methods" title="Cors::allowed_methods"><code>Cors::allowed_methods</code></a> for more info on allowed methods.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_methods" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#213-235" title="goto source code">[src]</a></div><a href="#method.allowed_methods" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_methods" class="fnname">allowed_methods</a>&lt;U, M&gt;(self, methods: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = M&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;M as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of methods which allowed origins can perform.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_methods" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#212-234" title="goto source code">[src]</a></div><a href="#method.allowed_methods" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_methods" class="fnname">allowed_methods</a>&lt;U, M&gt;(self, methods: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = M&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;M as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of methods which allowed origins can perform.</p>
<p>These will be sent in the <code>Access-Control-Allow-Methods</code> response header as specified in <p>These will be sent in the <code>Access-Control-Allow-Methods</code> response header as specified in
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p> the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
<p>Defaults to <code>[GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]</code></p> <p>Defaults to <code>[GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#240-246" title="goto source code">[src]</a></div><a href="#method.allow_any_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_header" class="fnname">allow_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed request header list to a state where any header is accepted.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allow_any_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#239-245" title="goto source code">[src]</a></div><a href="#method.allow_any_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allow_any_header" class="fnname">allow_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets allowed request header list to a state where any header is accepted.</p>
<p>See <a href="struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p> <p>See <a href="struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#251-274" title="goto source code">[src]</a></div><a href="#method.allowed_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_header" class="fnname">allowed_header</a>&lt;H&gt;(self, header: H) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Add an allowed request header.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#250-272" title="goto source code">[src]</a></div><a href="#method.allowed_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_header" class="fnname">allowed_header</a>&lt;H&gt;(self, header: H) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Add an allowed request header.</p>
<p>See <a href="struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p> <p>See <a href="struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_headers" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#286-314" title="goto source code">[src]</a></div><a href="#method.allowed_headers" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_headers" class="fnname">allowed_headers</a>&lt;U, H&gt;(self, headers: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of request header field names which can be used when this resource is accessed by </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.allowed_headers" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#284-311" title="goto source code">[src]</a></div><a href="#method.allowed_headers" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.allowed_headers" class="fnname">allowed_headers</a>&lt;U, H&gt;(self, headers: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of request header field names which can be used when this resource is accessed by
allowed origins.</p> allowed origins.</p>
<p>If <code>All</code> is set, whatever is requested by the client in <code>Access-Control-Request-Headers</code> <p>If <code>All</code> is set, whatever is requested by the client in <code>Access-Control-Request-Headers</code>
will be echoed back in the <code>Access-Control-Allow-Headers</code> header as specified in will be echoed back in the <code>Access-Control-Allow-Headers</code> header as specified in
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p> the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
<p>Defaults to <code>All</code>.</p> <p>Defaults to <code>All</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expose_any_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#319-325" title="goto source code">[src]</a></div><a href="#method.expose_any_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expose_any_header" class="fnname">expose_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets exposed response header list to a state where any header is accepted.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expose_any_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#316-322" title="goto source code">[src]</a></div><a href="#method.expose_any_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expose_any_header" class="fnname">expose_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Resets exposed response header list to a state where any header is accepted.</p>
<p>See <a href="struct.Cors.html#method.expose_headers" title="Cors::expose_headers"><code>Cors::expose_headers</code></a> for more info on exposed response headers.</p> <p>See <a href="struct.Cors.html#method.expose_headers" title="Cors::expose_headers"><code>Cors::expose_headers</code></a> for more info on exposed response headers.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expose_headers" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#334-361" title="goto source code">[src]</a></div><a href="#method.expose_headers" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expose_headers" class="fnname">expose_headers</a>&lt;U, H&gt;(self, headers: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of headers which are safe to expose to the API of a CORS API specification. </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expose_headers" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#331-357" title="goto source code">[src]</a></div><a href="#method.expose_headers" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expose_headers" class="fnname">expose_headers</a>&lt;U, H&gt;(self, headers: U) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = H&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</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="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>Set a list of headers which are safe to expose to the API of a CORS API specification.
This corresponds to the <code>Access-Control-Expose-Headers</code> response header as specified in This corresponds to the <code>Access-Control-Expose-Headers</code> response header as specified in
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p> the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
<p>This defaults to an empty set.</p> <p>This defaults to an empty set.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.max_age" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#370-376" title="goto source code">[src]</a></div><a href="#method.max_age" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.max_age" class="fnname">max_age</a>(self, max_age: impl <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="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Set a maximum time (in seconds) for which this CORS request maybe cached. </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.max_age" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#366-372" title="goto source code">[src]</a></div><a href="#method.max_age" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.max_age" class="fnname">max_age</a>(self, max_age: impl <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="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;&gt;) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Set a maximum time (in seconds) for which this CORS request maybe cached.
This value is set as the <code>Access-Control-Max-Age</code> header as specified in This value is set as the <code>Access-Control-Max-Age</code> header as specified in
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p> the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
<p>Pass a number (of seconds) or use None to disable sending max age header.</p> <p>Pass a number (of seconds) or use None to disable sending max age header.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.send_wildcard" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#389-395" title="goto source code">[src]</a></div><a href="#method.send_wildcard" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.send_wildcard" class="fnname">send_wildcard</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Set to use wildcard origins.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.send_wildcard" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#385-391" title="goto source code">[src]</a></div><a href="#method.send_wildcard" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.send_wildcard" class="fnname">send_wildcard</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Set to use wildcard origins.</p>
<p>If send wildcard is set and the <code>allowed_origins</code> parameter is <code>All</code>, a wildcard <p>If send wildcard is set and the <code>allowed_origins</code> parameter is <code>All</code>, a wildcard
<code>Access-Control-Allow-Origin</code> response header is sent, rather than the requests <code>Access-Control-Allow-Origin</code> response header is sent, rather than the requests
<code>Origin</code> header.</p> <code>Origin</code> header.</p>
@ -83,7 +83,7 @@ the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard C
<code>allow_credentials</code> set to <code>true</code>. Depending on the mode of usage, this will either result <code>allow_credentials</code> set to <code>true</code>. Depending on the mode of usage, this will either result
in an <code>CorsError::CredentialsWithWildcardOrigin</code> error during actix launch or runtime.</p> in an <code>CorsError::CredentialsWithWildcardOrigin</code> error during actix launch or runtime.</p>
<p>Defaults to <code>false</code>.</p> <p>Defaults to <code>false</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.supports_credentials" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#412-418" title="goto source code">[src]</a></div><a href="#method.supports_credentials" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.supports_credentials" class="fnname">supports_credentials</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Allows users to make authenticated requests</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.supports_credentials" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#408-414" title="goto source code">[src]</a></div><a href="#method.supports_credentials" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.supports_credentials" class="fnname">supports_credentials</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Allows users to make authenticated requests</p>
<p>If true, injects the <code>Access-Control-Allow-Credentials</code> header in responses. This allows <p>If true, injects the <code>Access-Control-Allow-Credentials</code> header in responses. This allows
cookies and credentials to be submitted across domains as specified in cookies and credentials to be submitted across domains as specified in
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p> the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
@ -92,27 +92,27 @@ the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard C
<p>Defaults to <code>false</code>.</p> <p>Defaults to <code>false</code>.</p>
<p>A server initialization error will occur if credentials are allowed, but the Origin is set <p>A server initialization error will occur if credentials are allowed, but the Origin is set
to send wildcards (<code>*</code>); this is not allowed by the CORS protocol.</p> to send wildcards (<code>*</code>); this is not allowed by the CORS protocol.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.disable_vary_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#430-436" title="goto source code">[src]</a></div><a href="#method.disable_vary_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.disable_vary_header" class="fnname">disable_vary_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Disable <code>Vary</code> header support.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.disable_vary_header" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#426-432" title="goto source code">[src]</a></div><a href="#method.disable_vary_header" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.disable_vary_header" class="fnname">disable_vary_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Disable <code>Vary</code> header support.</p>
<p>When enabled the header <code>Vary: Origin</code> will be returned as per the Fetch Standard <p>When enabled the header <code>Vary: Origin</code> will be returned as per the Fetch Standard
implementation guidelines.</p> implementation guidelines.</p>
<p>Setting this header when the <code>Access-Control-Allow-Origin</code> is dynamically generated <p>Setting this header when the <code>Access-Control-Allow-Origin</code> is dynamically generated
(eg. when there is more than one allowed origin, and an Origin other than * is returned) (eg. when there is more than one allowed origin, and an Origin other than * is returned)
informs CDNs and other caches that the CORS headers are dynamic, and cannot be cached.</p> informs CDNs and other caches that the CORS headers are dynamic, and cannot be cached.</p>
<p>By default, <code>Vary</code> header support is enabled.</p> <p>By default, <code>Vary</code> header support is enabled.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.disable_preflight" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#444-450" title="goto source code">[src]</a></div><a href="#method.disable_preflight" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.disable_preflight" class="fnname">disable_preflight</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Disable support for preflight requests.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.disable_preflight" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#440-446" title="goto source code">[src]</a></div><a href="#method.disable_preflight" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.disable_preflight" class="fnname">disable_preflight</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>Disable support for preflight requests.</p>
<p>When enabled CORS middleware automatically handles <code>OPTIONS</code> requests. <p>When enabled CORS middleware automatically handles <code>OPTIONS</code> requests.
This is useful for application level middleware.</p> This is useful for application level middleware.</p>
<p>By default <em>preflight</em> support is enabled.</p> <p>By default <em>preflight</em> support is enabled.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#71" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#71" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#71" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#71" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Default" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#453-484" title="goto source code">[src]</a></div><a href="#impl-Default" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.default" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#458-483" title="goto source code">[src]</a></div><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>A restrictive (security paranoid) set of defaults.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Default" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#449-480" title="goto source code">[src]</a></div><a href="#impl-Default" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.default" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#454-479" title="goto source code">[src]</a></div><a href="#method.default" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></div></summary><div class="docblock"><p>A restrictive (security paranoid) set of defaults.</p>
<p><em>No</em> allowed origins, methods, request headers or exposed headers. Credentials <p><em>No</em> allowed origins, methods, request headers or exposed headers. Credentials
not supported. No max age (will use browsers default).</p> not supported. No max age (will use browsers default).</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#486-545" title="goto source code">[src]</a></div><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse, Error = Error&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="type">Response</a> = ServiceResponse</h4></div></summary><div class='docblock'><p>Responses produced by the service.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#482-539" title="goto source code">[src]</a></div><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse, Error = Error&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="type">Response</a> = ServiceResponse</h4></div></summary><div class='docblock'><p>Responses produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>Errors produced by the service.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>Errors produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.InitError" class="type trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.InitError" class="type">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Errors produced while building a transform service.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.InitError" class="type trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.InitError" class="type">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Errors produced while building a transform service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Transform" class="type trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Transform" class="type">Transform</a> = CorsMiddleware&lt;S&gt;</h4></div></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Transform" class="type trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Transform" class="type">Transform</a> = CorsMiddleware&lt;S&gt;</h4></div></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;Result&lt;Self::Transform, Self::InitError&gt;&gt;</h4></div></summary><div class='docblock'><p>The future response value.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;Result&lt;Self::Transform, Self::InitError&gt;&gt;</h4></div></summary><div class='docblock'><p>The future response value.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_transform" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#497-544" title="goto source code">[src]</a></div><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_transform" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_cors/builder.rs.html#493-538" title="goto source code">[src]</a></div><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Request identity middleware"><meta name="keywords" content="rust, rustlang, rust-lang, IdentityService"><title>IdentityService in actix_identity - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_identity/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct IdentityService</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.new">new</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E">Transform&lt;S, ServiceRequest&gt;</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">actix_identity</a></h2><div id="sidebar-vars" data-name="IdentityService" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_identity</a>::<wbr><a class="struct" href="#">IdentityService</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_identity/middleware.rs.html#29-31" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><code>pub struct IdentityService&lt;T&gt; { /* fields omitted */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Request identity middleware</p> <!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="Request identity middleware"><meta name="keywords" content="rust, rustlang, rust-lang, IdentityService"><title>IdentityService in actix_identity - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_identity/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct IdentityService</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.new">new</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E">Transform&lt;S, ServiceRequest&gt;</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-Same%3CT%3E">Same&lt;T&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><h2 class="location">Other items in<br><a href="index.html">actix_identity</a></h2><div id="sidebar-vars" data-name="IdentityService" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_identity</a>::<wbr><a class="struct" href="#">IdentityService</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_identity/middleware.rs.html#27-29" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust struct"><code>pub struct IdentityService&lt;T&gt; { /* fields omitted */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Request identity middleware</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">actix_web::App</span>; <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">actix_web::App</span>;
<span class="kw">use</span> <span class="ident">actix_identity</span>::{<span class="ident">CookieIdentityPolicy</span>, <span class="ident">IdentityService</span>}; <span class="kw">use</span> <span class="ident">actix_identity</span>::{<span class="ident">CookieIdentityPolicy</span>, <span class="ident">IdentityService</span>};
@ -11,13 +11,13 @@
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App::new</span>() <span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App::new</span>()
<span class="comment">// wrap policy into identity middleware</span> <span class="comment">// wrap policy into identity middleware</span>
.<span class="ident">wrap</span>(<span class="ident">IdentityService::new</span>(<span class="ident">policy</span>));</code></pre></div> .<span class="ident">wrap</span>(<span class="ident">IdentityService::new</span>(<span class="ident">policy</span>));</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#33-40" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#35-39" title="goto source code">[src]</a></div><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(backend: T) -&gt; Self</h4></div></summary><div class="docblock"><p>Create new identity service with specified backend.</p> </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#31-38" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#33-37" title="goto source code">[src]</a></div><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(backend: T) -&gt; Self</h4></div></summary><div class="docblock"><p>Create new identity service with specified backend.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#42-62" title="goto source code">[src]</a></div><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, T, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.IdentityPolicy.html" title="trait actix_identity::IdentityPolicy">IdentityPolicy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::Error: <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">StdError</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="type">Response</a> = ServiceResponse</h4></div></summary><div class='docblock'><p>Responses produced by the service.</p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Transform%3CS%2C%20ServiceRequest%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#40-60" title="goto source code">[src]</a></div><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, T, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.IdentityPolicy.html" title="trait actix_identity::IdentityPolicy">IdentityPolicy</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::Error: <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">StdError</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Response" class="type trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Response" class="type">Response</a> = ServiceResponse</h4></div></summary><div class='docblock'><p>Responses produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>Errors produced by the service.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>Errors produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.InitError" class="type trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.InitError" class="type">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Errors produced while building a transform service.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.InitError" class="type trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.InitError" class="type">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Errors produced while building a transform service.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Transform" class="type trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Transform" class="type">Transform</a> = IdentityServiceMiddleware&lt;S, T&gt;</h4></div></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Transform" class="type trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Transform" class="type">Transform</a> = IdentityServiceMiddleware&lt;S, T&gt;</h4></div></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;Result&lt;Self::Transform, Self::InitError&gt;&gt;</h4></div></summary><div class='docblock'><p>The future response value.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;Result&lt;Self::Transform, Self::InitError&gt;&gt;</h4></div></summary><div class='docblock'><p>The future response value.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_transform" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#56-61" title="goto source code">[src]</a></div><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new_transform" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_identity/middleware.rs.html#54-59" title="goto source code">[src]</a></div><a href="#method.new_transform" class="anchor"></a><h4 class="code-header">fn <a class="fnname">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Creates and returns a new Transform component, asynchronously</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,&nbsp;</span></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt;</h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.IdentityService.html" title="struct actix_identity::IdentityService">IdentityService</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,&nbsp;</span></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `actix_protobuf` crate."><meta name="keywords" content="rust, rustlang, rust-lang, actix_protobuf"><title>actix_protobuf - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_protobuf/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate actix_protobuf</h2><div class="block version"><div class="narrow-helper"></div><p>Version 0.7.0-beta.1</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_protobuf's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="actix_protobuf" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">actix_protobuf</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_protobuf/lib.rs.html#1-334" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> <!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 `actix_protobuf` crate."><meta name="keywords" content="rust, rustlang, rust-lang, actix_protobuf"><title>actix_protobuf - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_protobuf/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate actix_protobuf</h2><div class="block version"><div class="narrow-helper"></div><p>Version 0.7.0-beta.1</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_protobuf's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="actix_protobuf" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">actix_protobuf</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_protobuf/lib.rs.html#1-327" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.ProtoBuf.html" title="actix_protobuf::ProtoBuf struct">ProtoBuf</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ProtoBufConfig.html" title="actix_protobuf::ProtoBufConfig struct">ProtoBufConfig</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ProtoBufMessage.html" title="actix_protobuf::ProtoBufMessage struct">ProtoBufMessage</a></div><div class="item-right docblock-short"></div></div><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.ProtoBuf.html" title="actix_protobuf::ProtoBuf struct">ProtoBuf</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ProtoBufConfig.html" title="actix_protobuf::ProtoBufConfig struct">ProtoBufConfig</a></div><div class="item-right docblock-short"></div><div class="item-left module-item"><a class="struct" href="struct.ProtoBufMessage.html" title="actix_protobuf::ProtoBufMessage struct">ProtoBufMessage</a></div><div class="item-right docblock-short"></div></div><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="enum" href="enum.ProtoBufPayloadError.html" title="actix_protobuf::ProtoBufPayloadError enum">ProtoBufPayloadError</a></div><div class="item-right docblock-short"></div></div><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2> <div class="item-table"><div class="item-left module-item"><a class="enum" href="enum.ProtoBufPayloadError.html" title="actix_protobuf::ProtoBufPayloadError enum">ProtoBufPayloadError</a></div><div class="item-right docblock-short"></div></div><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="trait" href="trait.ProtoBufResponseBuilder.html" title="actix_protobuf::ProtoBufResponseBuilder trait">ProtoBufResponseBuilder</a></div><div class="item-right docblock-short"></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_protobuf" data-search-index-js="../search-index.js" data-search-js="../search.js"></div> <div class="item-table"><div class="item-left module-item"><a class="trait" href="trait.ProtoBufResponseBuilder.html" title="actix_protobuf::ProtoBufResponseBuilder trait">ProtoBufResponseBuilder</a></div><div class="item-right docblock-short"></div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_protobuf" data-search-index-js="../search-index.js" data-search-js="../search.js"></div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<!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 `ProtoBufResponseBuilder` trait in crate `actix_protobuf`."><meta name="keywords" content="rust, rustlang, rust-lang, ProtoBufResponseBuilder"><title>ProtoBufResponseBuilder in actix_protobuf - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_protobuf/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ProtoBufResponseBuilder</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.protobuf">protobuf</a></div><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><div class="sidebar-links"><a href="#impl-ProtoBufResponseBuilder-for-HttpResponseBuilder">HttpResponseBuilder</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">actix_protobuf</a></h2><div id="sidebar-vars" data-name="ProtoBufResponseBuilder" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">actix_protobuf</a>::<wbr><a class="trait" href="#">ProtoBufResponseBuilder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_protobuf/lib.rs.html#257-259" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ProtoBufResponseBuilder { <!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 `ProtoBufResponseBuilder` trait in crate `actix_protobuf`."><meta name="keywords" content="rust, rustlang, rust-lang, ProtoBufResponseBuilder"><title>ProtoBufResponseBuilder in actix_protobuf - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_protobuf/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Trait ProtoBufResponseBuilder</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.protobuf">protobuf</a></div><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><div class="sidebar-links"><a href="#impl-ProtoBufResponseBuilder-for-HttpResponseBuilder">HttpResponseBuilder</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">actix_protobuf</a></h2><div id="sidebar-vars" data-name="ProtoBufResponseBuilder" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">actix_protobuf</a>::<wbr><a class="trait" href="#">ProtoBufResponseBuilder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_protobuf/lib.rs.html#250-252" title="goto source code">[src]</a></span></h1><div class="docblock type-decl"><pre class="rust trait"><code>pub trait ProtoBufResponseBuilder {
fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;; fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;;
}</code></pre></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><div id="tymethod.protobuf" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#258" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;</h4></div></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-ProtoBufResponseBuilder-for-HttpResponseBuilder" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#261-271" title="goto source code">[src]</a></div><a href="#impl-ProtoBufResponseBuilder-for-HttpResponseBuilder" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.ProtoBufResponseBuilder.html" title="trait actix_protobuf::ProtoBufResponseBuilder">ProtoBufResponseBuilder</a> for HttpResponseBuilder</h3></div></summary><div class="impl-items"><div id="method.protobuf" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#262-270" title="goto source code">[src]</a></div><a href="#method.protobuf" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;</h4></div></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/actix_protobuf/trait.ProtoBufResponseBuilder.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_protobuf" data-search-index-js="../search-index.js" data-search-js="../search.js"></div> }</code></pre></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><div id="tymethod.protobuf" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#251" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;</h4></div></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-ProtoBufResponseBuilder-for-HttpResponseBuilder" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#254-264" title="goto source code">[src]</a></div><a href="#impl-ProtoBufResponseBuilder-for-HttpResponseBuilder" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.ProtoBufResponseBuilder.html" title="trait actix_protobuf::ProtoBufResponseBuilder">ProtoBufResponseBuilder</a> for HttpResponseBuilder</h3></div></summary><div class="impl-items"><div id="method.protobuf" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_protobuf/lib.rs.html#255-263" title="goto source code">[src]</a></div><a href="#method.protobuf" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.protobuf" class="fnname">protobuf</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/prost/0.7.0/prost/message/trait.Message.html" title="trait prost::message::Message">Message</a>&gt;(&amp;mut self, value: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;HttpResponse, Error&gt;</h4></div></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/actix_protobuf/trait.ProtoBufResponseBuilder.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_protobuf" data-search-index-js="../search-index.js" data-search-js="../search.js"></div>
<script src="../main.js"></script> <script src="../main.js"></script>
</body></html> </body></html>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Sessions for Actix Web."><meta name="keywords" content="rust, rustlang, rust-lang, actix_session"><title>actix_session - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_session/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate actix_session</h2><div class="block version"><div class="narrow-helper"></div><p>Version 0.5.0-beta.2</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_session's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="actix_session" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">actix_session</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_session/lib.rs.html#1-411" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sessions for Actix Web.</p> <!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="Sessions for Actix Web."><meta name="keywords" content="rust, rustlang, rust-lang, actix_session"><title>actix_session - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../actix_session/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Crate actix_session</h2><div class="block version"><div class="narrow-helper"></div><p>Version 0.5.0-beta.2</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_session's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="actix_session" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">actix_session</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_session/lib.rs.html#1-401" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Sessions for Actix Web.</p>
<p>Provides a general solution for session management. Session middleware could provide different <p>Provides a general solution for session management. Session middleware could provide different
implementations which could be accessed via general session API.</p> implementations which could be accessed via general session API.</p>
<p>This crate provides a general solution for session management and includes a cookie backend. <p>This crate provides a general solution for session management and includes a cookie backend.

File diff suppressed because one or more lines are too long

View File

@ -15,21 +15,21 @@ implemented for <code>HttpRequest</code>, <code>ServiceRequest</code>, and <code
<span class="prelude-val">Ok</span>(<span class="string">&quot;Welcome!&quot;</span>) <span class="prelude-val">Ok</span>(<span class="string">&quot;Welcome!&quot;</span>)
}</code></pre></div> }</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#147-295" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#149-155" title="goto source code">[src]</a></div><a href="#method.get" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/serde/1.0.130/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>&gt;(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <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="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;, Error&gt;</h4></div></summary><div class="docblock"><p>Get a <code>value</code> from the session.</p> </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#147-285" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#149-155" title="goto source code">[src]</a></div><a href="#method.get" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/serde/1.0.130/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>&gt;(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <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="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;, Error&gt;</h4></div></summary><div class="docblock"><p>Get a <code>value</code> from the session.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.entries" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#160-162" title="goto source code">[src]</a></div><a href="#method.entries" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.entries" class="fnname">entries</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/cell/struct.Ref.html" title="struct core::cell::Ref">Ref</a>&lt;'_, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Get all raw key-value data from the session.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.entries" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#160-162" title="goto source code">[src]</a></div><a href="#method.entries" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.entries" class="fnname">entries</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/cell/struct.Ref.html" title="struct core::cell::Ref">Ref</a>&lt;'_, <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Get all raw key-value data from the session.</p>
<p>Note that values are JSON encoded.</p> <p>Note that values are JSON encoded.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.insert" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#168-182" title="goto source code">[src]</a></div><a href="#method.insert" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: impl <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="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;value: impl <a class="trait" href="https://docs.rs/serde/1.0.130/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a><br>) -&gt; <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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error&gt;</h4></div></summary><div class="docblock"><p>Inserts a key-value pair into the session.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.insert" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#168-178" title="goto source code">[src]</a></div><a href="#method.insert" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: impl <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="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;value: impl <a class="trait" href="https://docs.rs/serde/1.0.130/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a><br>) -&gt; <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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error&gt;</h4></div></summary><div class="docblock"><p>Inserts a key-value pair into the session.</p>
<p>Any serializable value can be used and will be encoded as JSON in session data, hence why <p>Any serializable value can be used and will be encoded as JSON in session data, hence why
only a reference to the value is taken.</p> only a reference to the value is taken.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#187-196" title="goto source code">[src]</a></div><a href="#method.remove" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove" class="fnname">remove</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</h4></div></summary><div class="docblock"><p>Remove value from the session.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#183-192" title="goto source code">[src]</a></div><a href="#method.remove" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove" class="fnname">remove</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</h4></div></summary><div class="docblock"><p>Remove value from the session.</p>
<p>If present, the JSON encoded value is returned.</p> <p>If present, the JSON encoded value is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove_as" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#202-218" title="goto source code">[src]</a></div><a href="#method.remove_as" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove_as" class="fnname">remove_as</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/serde/1.0.130/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<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="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Remove value from the session and deserialize.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.remove_as" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#198-211" title="goto source code">[src]</a></div><a href="#method.remove_as" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.remove_as" class="fnname">remove_as</a>&lt;T:&nbsp;<a class="trait" href="https://docs.rs/serde/1.0.130/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<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="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Remove value from the session and deserialize.</p>
<p>Returns None if key was not present in session. Returns T if deserialization succeeds, <p>Returns None if key was not present in session. Returns T if deserialization succeeds,
otherwise returns un-deserialized JSON string.</p> otherwise returns un-deserialized JSON string.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clear" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#221-228" title="goto source code">[src]</a></div><a href="#method.clear" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Clear the session.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clear" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#214-221" title="goto source code">[src]</a></div><a href="#method.clear" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Clear the session.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.purge" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#231-235" title="goto source code">[src]</a></div><a href="#method.purge" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.purge" class="fnname">purge</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Removes session both client and server side.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.purge" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#224-228" title="goto source code">[src]</a></div><a href="#method.purge" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.purge" class="fnname">purge</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Removes session both client and server side.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.renew" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#238-244" title="goto source code">[src]</a></div><a href="#method.renew" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.renew" class="fnname">renew</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Renews the session key, assigning existing session state to new key.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.renew" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#231-237" title="goto source code">[src]</a></div><a href="#method.renew" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.renew" class="fnname">renew</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Renews the session key, assigning existing session state to new key.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.set_session" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#262-269" title="goto source code">[src]</a></div><a href="#method.set_session" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.set_session" class="fnname">set_session</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;mut ServiceRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;data: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;<br>)</h4></div></summary><div class="docblock"><p>Adds the given key-value pairs to the session on the request.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.set_session" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#255-259" title="goto source code">[src]</a></div><a href="#method.set_session" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.set_session" class="fnname">set_session</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;mut ServiceRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;data: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;<br>)</h4></div></summary><div class="docblock"><p>Adds the given key-value pairs to the session on the request.</p>
<p>Values that match keys already existing on the session will be overwritten. Values should <p>Values that match keys already existing on the session will be overwritten. Values should
already be JSON serialized.</p> already be JSON serialized.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1> <h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
@ -39,8 +39,8 @@ already be JSON serialized.</p>
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">req</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">req</span>,
<span class="macro">vec!</span>[(<span class="string">&quot;counter&quot;</span>.<span class="ident">to_string</span>(), <span class="ident">serde_json::to_string</span>(<span class="kw-2">&amp;</span><span class="number">0</span>).<span class="ident">unwrap</span>())], <span class="macro">vec!</span>[(<span class="string">&quot;counter&quot;</span>.<span class="ident">to_string</span>(), <span class="ident">serde_json::to_string</span>(<span class="kw-2">&amp;</span><span class="number">0</span>).<span class="ident">unwrap</span>())],
);</code></pre></div> );</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_changes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#272-285" title="goto source code">[src]</a></div><a href="#method.get_changes" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_changes" class="fnname">get_changes</a>&lt;B&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;res: &amp;mut ServiceResponse&lt;B&gt;<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="enum.SessionStatus.html" title="enum actix_session::SessionStatus">SessionStatus</a>, impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></h4></div></summary><div class="docblock"><p>Returns session status and iterator of key-value pairs of changes.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.get_changes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#262-275" title="goto source code">[src]</a></div><a href="#method.get_changes" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_changes" class="fnname">get_changes</a>&lt;B&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;res: &amp;mut ServiceResponse&lt;B&gt;<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="enum.SessionStatus.html" title="enum actix_session::SessionStatus">SessionStatus</a>, impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></h4></div></summary><div class="docblock"><p>Returns session status and iterator of key-value pairs of changes.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#317-326" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></summary><div class="docblock"><p>Extractor implementation for Session type.</p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#307-316" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></summary><div class="docblock"><p>Extractor implementation for Session type.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1> <h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">actix_session::Session</span>; <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">actix_session::Session</span>;
@ -59,7 +59,7 @@ already be JSON serialized.</p>
</div><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p> </div><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = Error</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<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="struct.Session.html" title="struct actix_session::Session">Session</a>, Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<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="struct.Session.html" title="struct actix_session::Session">Session</a>, Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#323-325" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(req: &amp;HttpRequest, _: &amp;mut Payload) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../src/actix_session/lib.rs.html#313-315" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(req: &amp;HttpRequest, _: &amp;mut Payload) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Session.html" title="struct actix_session::Session">Session</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Extractor for the “Basic” HTTP Authentication Scheme"><meta name="keywords" content="rust, rustlang, rust-lang, basic"><title>actix_web_httpauth::extractors::basic - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module basic</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="basic" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">actix_web_httpauth</a>::<wbr><a href="../index.html">extractors</a>::<wbr><a class="mod" href="#">basic</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/extractors/basic.rs.html#1-152" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extractor for the “Basic” HTTP Authentication Scheme</p> <!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="Extractor for the “Basic” HTTP Authentication Scheme"><meta name="keywords" content="rust, rustlang, rust-lang, basic"><title>actix_web_httpauth::extractors::basic - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module basic</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="basic" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">actix_web_httpauth</a>::<wbr><a href="../index.html">extractors</a>::<wbr><a class="mod" href="#">basic</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/extractors/basic.rs.html#1-149" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extractor for the “Basic” HTTP Authentication Scheme</p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> </div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.BasicAuth.html" title="actix_web_httpauth::extractors::basic::BasicAuth struct">BasicAuth</a></div><div class="item-right docblock-short"><p>Extractor for HTTP Basic auth.</p> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.BasicAuth.html" title="actix_web_httpauth::extractors::basic::BasicAuth struct">BasicAuth</a></div><div class="item-right docblock-short"><p>Extractor for HTTP Basic auth.</p>
</div><div class="item-left module-item"><a class="struct" href="struct.Config.html" title="actix_web_httpauth::extractors::basic::Config struct">Config</a></div><div class="item-right docblock-short"><p><a href="./struct.BasicAuth.html"><code>BasicAuth</code></a> extractor configuration, </div><div class="item-left module-item"><a class="struct" href="struct.Config.html" title="actix_web_httpauth::extractors::basic::Config struct">Config</a></div><div class="item-right docblock-short"><p><a href="./struct.BasicAuth.html"><code>BasicAuth</code></a> extractor configuration,

View File

@ -24,16 +24,16 @@ response header.</p>
}</code></pre></div> }</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#94-104" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.user_id" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#96-98" title="goto source code">[src]</a></div><a href="#method.user_id" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.user_id" class="fnname">user_id</a>(&amp;self) -&gt; &amp;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></div></summary><div class="docblock"><p>Returns clients user-ID.</p> </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#94-104" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.user_id" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#96-98" title="goto source code">[src]</a></div><a href="#method.user_id" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.user_id" class="fnname">user_id</a>(&amp;self) -&gt; &amp;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></div></summary><div class="docblock"><p>Returns clients user-ID.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.password" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#101-103" title="goto source code">[src]</a></div><a href="#method.password" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.password" class="fnname">password</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Returns clients password.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.password" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#101-103" title="goto source code">[src]</a></div><a href="#method.password" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.password" class="fnname">password</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Returns clients password.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#132-152" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="../trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/basic/struct.Basic.html" title="struct actix_web_httpauth::headers::www_authenticate::basic::Basic">Challenge</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#129-149" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="../trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/basic/struct.Basic.html" title="struct actix_web_httpauth::headers::www_authenticate::basic::Basic">Challenge</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves into extracted credentials type.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves into extracted credentials type.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_service_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#136-151" title="goto source code">[src]</a></div><a href="#method.from_service_request" class="anchor"></a><h4 class="code-header">fn <a href="../trait.AuthExtractor.html#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class='docblock'><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_service_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#133-148" title="goto source code">[src]</a></div><a href="#method.from_service_request" class="anchor"></a><h4 class="code-header">fn <a href="../trait.AuthExtractor.html#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class='docblock'><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#91" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#106-130" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future-1" class="type trait-impl has-srclink"><a href="#associatedtype.Future-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#106-127" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future-1" class="type trait-impl has-srclink"><a href="#associatedtype.Future-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="struct" href="struct.Config.html" title="struct actix_web_httpauth::extractors::basic::Config">Config</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="struct" href="struct.Config.html" title="struct actix_web_httpauth::extractors::basic::Config">Config</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/basic/struct.Basic.html" title="struct actix_web_httpauth::headers::www_authenticate::basic::Basic">Challenge</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/basic/struct.Basic.html" title="struct actix_web_httpauth::headers::www_authenticate::basic::Basic">Challenge</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#111-129" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;HttpRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut Payload<br>) -&gt; &lt;Self as FromRequest&gt;::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/basic.rs.html#111-126" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;HttpRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;_: &amp;mut Payload<br>) -&gt; &lt;Self as FromRequest&gt;::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Extractor for the “Bearer” HTTP Authentication Scheme"><meta name="keywords" content="rust, rustlang, rust-lang, bearer"><title>actix_web_httpauth::extractors::bearer - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module bearer</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><div id="sidebar-vars" data-name="bearer" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">actix_web_httpauth</a>::<wbr><a href="../index.html">extractors</a>::<wbr><a class="mod" href="#">bearer</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/extractors/bearer.rs.html#1-180" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extractor for the “Bearer” HTTP Authentication Scheme</p> <!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="Extractor for the “Bearer” HTTP Authentication Scheme"><meta name="keywords" content="rust, rustlang, rust-lang, bearer"><title>actix_web_httpauth::extractors::bearer - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module bearer</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><div id="sidebar-vars" data-name="bearer" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">actix_web_httpauth</a>::<wbr><a href="../index.html">extractors</a>::<wbr><a class="mod" href="#">bearer</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/extractors/bearer.rs.html#1-177" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extractor for the “Bearer” HTTP Authentication Scheme</p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> </div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.BearerAuth.html" title="actix_web_httpauth::extractors::bearer::BearerAuth struct">BearerAuth</a></div><div class="item-right docblock-short"><p>Extractor for HTTP Bearer auth</p> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.BearerAuth.html" title="actix_web_httpauth::extractors::bearer::BearerAuth struct">BearerAuth</a></div><div class="item-right docblock-short"><p>Extractor for HTTP Bearer auth</p>
</div><div class="item-left module-item"><a class="struct" href="struct.Config.html" title="actix_web_httpauth::extractors::bearer::Config struct">Config</a></div><div class="item-right docblock-short"><p><a href="./struct/BearerAuth.html">BearerAuth</a> extractor configuration.</p> </div><div class="item-left module-item"><a class="struct" href="struct.Config.html" title="actix_web_httpauth::extractors::bearer::Config struct">Config</a></div><div class="item-right docblock-short"><p><a href="./struct/BearerAuth.html">BearerAuth</a> extractor configuration.</p>

View File

@ -26,16 +26,16 @@ response header.</p>
.<span class="ident">service</span>(<span class="ident">web::resource</span>(<span class="string">&quot;/index.html&quot;</span>).<span class="ident">route</span>(<span class="ident">web::get</span>().<span class="ident">to</span>(<span class="ident">index</span>))); .<span class="ident">service</span>(<span class="ident">web::resource</span>(<span class="string">&quot;/index.html&quot;</span>).<span class="ident">route</span>(<span class="ident">web::get</span>().<span class="ident">to</span>(<span class="ident">index</span>)));
}</code></pre></div> }</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#98-103" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.token" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#100-102" title="goto source code">[src]</a></div><a href="#method.token" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.token" class="fnname">token</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></div></summary><div class="docblock"><p>Returns bearer token provided by client.</p> </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#98-103" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.token" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#100-102" title="goto source code">[src]</a></div><a href="#method.token" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.token" class="fnname">token</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></div></summary><div class="docblock"><p>Returns bearer token provided by client.</p>
</div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#129-147" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="../trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves into extracted credentials type.</p> </div></details></div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#126-144" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="../trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="type trait-impl has-srclink"><a href="#associatedtype.Future" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves into extracted credentials type.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/bearer/struct.Bearer.html" title="struct actix_web_httpauth::headers::www_authenticate::bearer::Bearer">Bearer</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="../trait.AuthExtractor.html#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/bearer/struct.Bearer.html" title="struct actix_web_httpauth::headers::www_authenticate::bearer::Bearer">Bearer</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_service_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#133-146" title="goto source code">[src]</a></div><a href="#method.from_service_request" class="anchor"></a><h4 class="code-header">fn <a href="../trait.AuthExtractor.html#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class='docblock'><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_service_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#130-143" title="goto source code">[src]</a></div><a href="#method.from_service_request" class="anchor"></a><h4 class="code-header">fn <a href="../trait.AuthExtractor.html#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="../trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class='docblock'><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Clone" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h4></div></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clone_from" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></div><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></div></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Debug" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fmt" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#95" title="goto source code">[src]</a></div><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#105-127" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="struct" href="struct.Config.html" title="struct actix_web_httpauth::extractors::bearer::Config">Config</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-FromRequest" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#105-124" title="goto source code">[src]</a></div><a href="#impl-FromRequest" class="anchor"></a><h3 class="code-header in-band">impl FromRequest for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Config" class="type trait-impl has-srclink"><a href="#associatedtype.Config" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Config" class="type">Config</a> = <a class="struct" href="struct.Config.html" title="struct actix_web_httpauth::extractors::bearer::Config">Config</a></h4></div></summary><div class='docblock'><p>Configuration for this extractor.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future-1" class="type trait-impl has-srclink"><a href="#associatedtype.Future-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future-1" class="type trait-impl has-srclink"><a href="#associatedtype.Future-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a> = Ready&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::Error&gt;&gt;</h4></div></summary><div class='docblock'><p>Future that resolves to a Self.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/bearer/struct.Bearer.html" title="struct actix_web_httpauth::headers::www_authenticate::bearer::Bearer">Bearer</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a> = <a class="struct" href="../struct.AuthenticationError.html" title="struct actix_web_httpauth::extractors::AuthenticationError">AuthenticationError</a>&lt;<a class="struct" href="../../headers/www_authenticate/bearer/struct.Bearer.html" title="struct actix_web_httpauth::headers::www_authenticate::bearer::Bearer">Bearer</a>&gt;</h4></div></summary><div class='docblock'><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#110-126" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;HttpRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;_payload: &amp;mut Payload<br>) -&gt; &lt;Self as FromRequest&gt;::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from_request" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/actix_web_httpauth/extractors/bearer.rs.html#110-123" title="goto source code">[src]</a></div><a href="#method.from_request" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from_request</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;req: &amp;HttpRequest, <br>&nbsp;&nbsp;&nbsp;&nbsp;_payload: &amp;mut Payload<br>) -&gt; &lt;Self as FromRequest&gt;::Future</h4></div></summary><div class='docblock'><p>Create a Self from request parts asynchronously.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.extract" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.extract" class="anchor"></a><h4 class="code-header">fn <a href="#method.extract" class="fnname">extract</a>(req: &amp;HttpRequest) -&gt; Self::Future</h4></div></summary><div class='docblock'><p>Create a Self from request head asynchronously. <a href="#method.extract">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.configure" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.configure" class="anchor"></a><h4 class="code-header">fn <a href="#method.configure" class="fnname">configure</a>&lt;F&gt;(f: F) -&gt; Self::Config <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(Self::Config) -&gt; Self::Config,&nbsp;</span></h4></div></summary><div class='docblock'><p>Create and configure config instance.</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,6 @@ authentication scheme.</p>
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#26" title="goto source code">[src]</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&gt;</h4></div></summary><div class="docblock"><p>The associated error which can be returned.</p> </div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#26" title="goto source code">[src]</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="type">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&gt;</h4></div></summary><div class="docblock"><p>The associated error which can be returned.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#29" title="goto source code">[src]</a></div><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Future that resolves into extracted credentials type.</p> </div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Future" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#29" title="goto source code">[src]</a></div><h4 class="code-header">type <a href="#associatedtype.Future" class="type">Future</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="trait.AuthExtractor.html#associatedtype.Error" title="type actix_web_httpauth::extractors::AuthExtractor::Error">Error</a>&gt;&gt;</h4></div></summary><div class="docblock"><p>Future that resolves into extracted credentials type.</p>
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.from_service_request" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#32" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class="docblock"><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p> </div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.from_service_request" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/mod.rs.html#32" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.from_service_request" class="fnname">from_service_request</a>(req: &amp;ServiceRequest) -&gt; Self::<a class="type" href="trait.AuthExtractor.html#associatedtype.Future" title="type actix_web_httpauth::extractors::AuthExtractor::Future">Future</a></h4></div></summary><div class="docblock"><p>Parse the authentication credentials from the actix <code>ServiceRequest</code>.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/basic.rs.html#132-152" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-AuthExtractor-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/bearer.rs.html#129-147" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></div><script type="text/javascript" src="../../implementors/actix_web_httpauth/extractors/trait.AuthExtractor.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div> </div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-AuthExtractor" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/basic.rs.html#129-149" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a></h3></div><div id="impl-AuthExtractor-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/extractors/bearer.rs.html#126-144" title="goto source code">[src]</a></div><a href="#impl-AuthExtractor-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> for <a class="struct" href="bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a></h3></div></div><script type="text/javascript" src="../../implementors/actix_web_httpauth/extractors/trait.AuthExtractor.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div>
<script src="../../main.js"></script> <script src="../../main.js"></script>
</body></html> </body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="HTTP Authentication middleware."><meta name="keywords" content="rust, rustlang, rust-lang, middleware"><title>actix_web_httpauth::middleware - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module middleware</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="middleware" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">actix_web_httpauth</a>::<wbr><a class="mod" href="#">middleware</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/middleware.rs.html#1-313" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP Authentication middleware.</p> <!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="HTTP Authentication middleware."><meta name="keywords" content="rust, rustlang, rust-lang, middleware"><title>actix_web_httpauth::middleware - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../actix_web_httpauth/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module middleware</h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="middleware" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">actix_web_httpauth</a>::<wbr><a class="mod" href="#">middleware</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_httpauth/middleware.rs.html#1-312" title="goto source code">[src]</a></span></h1><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP Authentication middleware.</p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> </div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.HttpAuthentication.html" title="actix_web_httpauth::middleware::HttpAuthentication struct">HttpAuthentication</a></div><div class="item-right docblock-short"><p>Middleware for checking HTTP authentication.</p> <div class="item-table"><div class="item-left module-item"><a class="struct" href="struct.HttpAuthentication.html" title="actix_web_httpauth::middleware::HttpAuthentication struct">HttpAuthentication</a></div><div class="item-right docblock-short"><p>Middleware for checking HTTP authentication.</p>
</div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div> </div></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-search-index-js="../../search-index.js" data-search-js="../../search.js"></div>

File diff suppressed because one or more lines are too long

View File

@ -617,12 +617,6 @@
<span id="617">617</span> <span id="617">617</span>
<span id="618">618</span> <span id="618">618</span>
<span id="619">619</span> <span id="619">619</span>
<span id="620">620</span>
<span id="621">621</span>
<span id="622">622</span>
<span id="623">623</span>
<span id="624">624</span>
<span id="625">625</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashSet</span>, <span class="ident">convert::TryInto</span>, <span class="ident">iter::FromIterator</span>, <span class="ident">rc::Rc</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashSet</span>, <span class="ident">convert::TryInto</span>, <span class="ident">iter::FromIterator</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::{ <span class="kw">use</span> <span class="ident">actix_web</span>::{
@ -775,8 +769,7 @@
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_origins</span>.<span class="ident">is_all</span>() { <span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_origins</span>.<span class="ident">is_all</span>() {
<span class="ident">cors</span>.<span class="ident">allowed_origins</span> <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_origins</span> <span class="op">=</span> <span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
<span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
} }
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">origins</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_origins</span>.<span class="ident">as_mut</span>() { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">origins</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_origins</span>.<span class="ident">as_mut</span>() {
@ -882,8 +875,7 @@
<span class="kw">match</span> <span class="ident">header</span>.<span class="ident">try_into</span>() { <span class="kw">match</span> <span class="ident">header</span>.<span class="ident">try_into</span>() {
<span class="prelude-val">Ok</span>(<span class="ident">method</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Ok</span>(<span class="ident">method</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span>.<span class="ident">is_all</span>() { <span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span>.<span class="ident">is_all</span>() {
<span class="ident">cors</span>.<span class="ident">allowed_headers</span> <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> <span class="op">=</span> <span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
<span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
} }
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> {
@ -919,8 +911,7 @@
<span class="kw">match</span> <span class="ident">h</span>.<span class="ident">try_into</span>() { <span class="kw">match</span> <span class="ident">h</span>.<span class="ident">try_into</span>() {
<span class="prelude-val">Ok</span>(<span class="ident">method</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Ok</span>(<span class="ident">method</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span>.<span class="ident">is_all</span>() { <span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span>.<span class="ident">is_all</span>() {
<span class="ident">cors</span>.<span class="ident">allowed_headers</span> <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> <span class="op">=</span> <span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
<span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
} }
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">allowed_headers</span> {
@ -967,8 +958,7 @@
<span class="prelude-val">Ok</span>(<span class="ident">header</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Ok</span>(<span class="ident">header</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cors</span>) <span class="op">=</span> <span class="ident">cors</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">inner</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">error</span>) { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cors</span>) <span class="op">=</span> <span class="ident">cors</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">inner</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">error</span>) {
<span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">expose_headers</span>.<span class="ident">is_all</span>() { <span class="kw">if</span> <span class="ident">cors</span>.<span class="ident">expose_headers</span>.<span class="ident">is_all</span>() {
<span class="ident">cors</span>.<span class="ident">expose_headers</span> <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">expose_headers</span> <span class="op">=</span> <span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
<span class="ident">AllOrSome::Some</span>(<span class="ident">HashSet::with_capacity</span>(<span class="number">8</span>));
} }
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">expose_headers</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="ident">AllOrSome::Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">cors</span>.<span class="ident">expose_headers</span> {
<span class="ident">headers</span>.<span class="ident">insert</span>(<span class="ident">header</span>); <span class="ident">headers</span>.<span class="ident">insert</span>(<span class="ident">header</span>);
@ -1131,12 +1121,11 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="ident">Rc::clone</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">inner</span>); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="ident">Rc::clone</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">inner</span>);
<span class="kw">if</span> <span class="ident">inner</span>.<span class="ident">supports_credentials</span> <span class="kw">if</span> <span class="ident">inner</span>.<span class="ident">supports_credentials</span> <span class="op">&amp;&amp;</span> <span class="ident">inner</span>.<span class="ident">send_wildcard</span> <span class="op">&amp;&amp;</span> <span class="ident">inner</span>.<span class="ident">allowed_origins</span>.<span class="ident">is_all</span>() {
<span class="op">&amp;&amp;</span> <span class="ident">inner</span>.<span class="ident">send_wildcard</span> <span class="macro">error!</span>(
<span class="op">&amp;&amp;</span> <span class="ident">inner</span>.<span class="ident">allowed_origins</span>.<span class="ident">is_all</span>() <span class="string">&quot;Illegal combination of CORS options: credentials can not be supported when all \
{ origins are allowed and `send_wildcard` is enabled.&quot;</span>
<span class="macro">error!</span>(<span class="string">&quot;Illegal combination of CORS options: credentials can not be supported when all \ );
origins are allowed and `send_wildcard` is enabled.&quot;</span>);
<span class="kw">return</span> <span class="ident">future::err</span>(()); <span class="kw">return</span> <span class="ident">future::err</span>(());
} }
@ -1144,8 +1133,7 @@
<span class="kw">match</span> <span class="ident">inner</span>.<span class="ident">allowed_headers</span>.<span class="ident">as_ref</span>() { <span class="kw">match</span> <span class="ident">inner</span>.<span class="ident">allowed_headers</span>.<span class="ident">as_ref</span>() {
<span class="prelude-val">Some</span>(<span class="ident">header_set</span>) <span class="kw">if</span> <span class="op">!</span><span class="ident">header_set</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Some</span>(<span class="ident">header_set</span>) <span class="kw">if</span> <span class="op">!</span><span class="ident">header_set</span>.<span class="ident">is_empty</span>() <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">allowed_headers_str</span> <span class="op">=</span> <span class="ident">intersperse_header_values</span>(<span class="ident">header_set</span>); <span class="kw">let</span> <span class="ident">allowed_headers_str</span> <span class="op">=</span> <span class="ident">intersperse_header_values</span>(<span class="ident">header_set</span>);
<span class="ident">Rc::make_mut</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">inner</span>).<span class="ident">allowed_headers_baked</span> <span class="op">=</span> <span class="ident">Rc::make_mut</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">inner</span>).<span class="ident">allowed_headers_baked</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">allowed_headers_str</span>);
<span class="prelude-val">Some</span>(<span class="ident">allowed_headers_str</span>);
} }
<span class="kw">_</span> <span class="op">=</span><span class="op">&gt;</span> {} <span class="kw">_</span> <span class="op">=</span><span class="op">&gt;</span> {}
} }

View File

@ -48,12 +48,6 @@
<span id="48">48</span> <span id="48">48</span>
<span id="49">49</span> <span id="49">49</span>
<span id="50">50</span> <span id="50">50</span>
<span id="51">51</span>
<span id="52">52</span>
<span id="53">53</span>
<span id="54">54</span>
<span id="55">55</span>
<span id="56">56</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http::StatusCode</span>, <span class="ident">HttpResponse</span>, <span class="ident">ResponseError</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">http::StatusCode</span>, <span class="ident">HttpResponse</span>, <span class="ident">ResponseError</span>};
<span class="kw">use</span> <span class="ident">derive_more</span>::{<span class="ident">Display</span>, <span class="ident">Error</span>}; <span class="kw">use</span> <span class="ident">derive_more</span>::{<span class="ident">Display</span>, <span class="ident">Error</span>};
@ -71,21 +65,15 @@
<span class="ident">MissingOrigin</span>, <span class="ident">MissingOrigin</span>,
<span class="doccomment">/// Request header `Access-Control-Request-Method` is required but is missing.</span> <span class="doccomment">/// Request header `Access-Control-Request-Method` is required but is missing.</span>
<span class="attribute">#[<span class="ident">display</span>( <span class="attribute">#[<span class="ident">display</span>(<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Method` is required but is missing.&quot;</span>)]</span>
<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Method` is required but is missing.&quot;</span>
)]</span>
<span class="ident">MissingRequestMethod</span>, <span class="ident">MissingRequestMethod</span>,
<span class="doccomment">/// Request header `Access-Control-Request-Method` has an invalid value.</span> <span class="doccomment">/// Request header `Access-Control-Request-Method` has an invalid value.</span>
<span class="attribute">#[<span class="ident">display</span>( <span class="attribute">#[<span class="ident">display</span>(<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Method` has an invalid value.&quot;</span>)]</span>
<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Method` has an invalid value.&quot;</span>
)]</span>
<span class="ident">BadRequestMethod</span>, <span class="ident">BadRequestMethod</span>,
<span class="doccomment">/// Request header `Access-Control-Request-Headers` has an invalid value.</span> <span class="doccomment">/// Request header `Access-Control-Request-Headers` has an invalid value.</span>
<span class="attribute">#[<span class="ident">display</span>( <span class="attribute">#[<span class="ident">display</span>(<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Headers` has an invalid value.&quot;</span>)]</span>
<span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;Request header `Access-Control-Request-Headers` has an invalid value.&quot;</span>
)]</span>
<span class="ident">BadRequestHeaders</span>, <span class="ident">BadRequestHeaders</span>,
<span class="doccomment">/// Origin is not allowed to make this request.</span> <span class="doccomment">/// Origin is not allowed to make this request.</span>

View File

@ -325,17 +325,6 @@
<span id="325">325</span> <span id="325">325</span>
<span id="326">326</span> <span id="326">326</span>
<span id="327">327</span> <span id="327">327</span>
<span id="328">328</span>
<span id="329">329</span>
<span id="330">330</span>
<span id="331">331</span>
<span id="332">332</span>
<span id="333">333</span>
<span id="334">334</span>
<span id="335">335</span>
<span id="336">336</span>
<span id="337">337</span>
<span id="338">338</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashSet</span>, <span class="ident">convert::TryFrom</span>, <span class="ident">convert::TryInto</span>, <span class="ident">fmt</span>, <span class="ident">rc::Rc</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashSet</span>, <span class="ident">convert::TryFrom</span>, <span class="ident">convert::TryInto</span>, <span class="ident">fmt</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::{ <span class="kw">use</span> <span class="ident">actix_web</span>::{
@ -416,9 +405,7 @@
<span class="kw">match</span> <span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ORIGIN</span>) { <span class="kw">match</span> <span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ORIGIN</span>) {
<span class="comment">// origin header exists and is a string</span> <span class="comment">// origin header exists and is a string</span>
<span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="ident">allowed_origins</span>.<span class="ident">contains</span>(<span class="ident">origin</span>) <span class="kw">if</span> <span class="ident">allowed_origins</span>.<span class="ident">contains</span>(<span class="ident">origin</span>) <span class="op">|</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">validate_origin_fns</span>(<span class="ident">origin</span>, <span class="ident">req</span>) {
<span class="op">|</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">validate_origin_fns</span>(<span class="ident">origin</span>, <span class="ident">req</span>)
{
<span class="prelude-val">Ok</span>(()) <span class="prelude-val">Ok</span>(())
} <span class="kw">else</span> { } <span class="kw">else</span> {
<span class="prelude-val">Err</span>(<span class="ident">CorsError::OriginNotAllowed</span>) <span class="prelude-val">Err</span>(<span class="ident">CorsError::OriginNotAllowed</span>)
@ -440,10 +427,7 @@
} }
<span class="doccomment">/// Only called if origin exists and always after it&#39;s validated.</span> <span class="doccomment">/// Only called if origin exists and always after it&#39;s validated.</span>
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">access_control_allow_origin</span>( <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">access_control_allow_origin</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">HeaderValue</span><span class="op">&gt;</span> {
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">HeaderValue</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ORIGIN</span>); <span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ORIGIN</span>);
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">allowed_origins</span> { <span class="kw">match</span> <span class="self">self</span>.<span class="ident">allowed_origins</span> {
@ -467,10 +451,7 @@
<span class="doccomment">/// Use in preflight checks and therefore operates on header list in</span> <span class="doccomment">/// Use in preflight checks and therefore operates on header list in</span>
<span class="doccomment">/// `Access-Control-Request-Headers` not the actual header set.</span> <span class="doccomment">/// `Access-Control-Request-Headers` not the actual header set.</span>
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">validate_allowed_method</span>( <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">validate_allowed_method</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">CorsError</span><span class="op">&gt;</span> {
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">CorsError</span><span class="op">&gt;</span> {
<span class="comment">// extract access control header and try to parse as method</span> <span class="comment">// extract access control header and try to parse as method</span>
<span class="kw">let</span> <span class="ident">request_method</span> <span class="op">=</span> <span class="ident">req</span> <span class="kw">let</span> <span class="ident">request_method</span> <span class="op">=</span> <span class="ident">req</span>
.<span class="ident">headers</span>() .<span class="ident">headers</span>()
@ -492,10 +473,7 @@
} }
} }
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">validate_allowed_headers</span>( <span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">validate_allowed_headers</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">CorsError</span><span class="op">&gt;</span> {
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">RequestHead</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">CorsError</span><span class="op">&gt;</span> {
<span class="comment">// return early if all headers are allowed or get ref to allowed origins set</span> <span class="comment">// return early if all headers are allowed or get ref to allowed origins set</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">clippy::mutable_key_type</span>)]</span> <span class="attribute">#[<span class="ident">allow</span>(<span class="ident">clippy::mutable_key_type</span>)]</span>
<span class="kw">let</span> <span class="ident">allowed_headers</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">allowed_headers</span> { <span class="kw">let</span> <span class="ident">allowed_headers</span> <span class="op">=</span> <span class="kw">match</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">allowed_headers</span> {

View File

@ -212,13 +212,6 @@
<span id="212">212</span> <span id="212">212</span>
<span id="213">213</span> <span id="213">213</span>
<span id="214">214</span> <span id="214">214</span>
<span id="215">215</span>
<span id="216">216</span>
<span id="217">217</span>
<span id="218">218</span>
<span id="219">219</span>
<span id="220">220</span>
<span id="221">221</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">convert::TryInto</span>, <span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">convert::TryInto</span>, <span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::{ <span class="kw">use</span> <span class="ident">actix_web</span>::{
@ -231,9 +224,7 @@
}, },
<span class="ident">HttpResponse</span>, <span class="ident">HttpResponse</span>,
}; };
<span class="kw">use</span> <span class="ident">futures_util::future</span>::{ <span class="kw">use</span> <span class="ident">futures_util::future</span>::{<span class="ident">ok</span>, <span class="ident">Either</span>, <span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>, <span class="ident">Ready</span>, <span class="ident">TryFutureExt</span> <span class="kw">as</span> <span class="kw">_</span>};
<span class="ident">ok</span>, <span class="ident">Either</span>, <span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>, <span class="ident">Ready</span>, <span class="ident">TryFutureExt</span> <span class="kw">as</span> <span class="kw">_</span>,
};
<span class="kw">use</span> <span class="ident">log::debug</span>; <span class="kw">use</span> <span class="ident">log::debug</span>;
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::Inner</span>; <span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::Inner</span>;
@ -274,9 +265,7 @@
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">allowed_headers_baked</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">headers</span>) <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">allowed_headers_baked</span> {
<span class="ident">res</span>.<span class="ident">insert_header</span>((<span class="ident">header::ACCESS_CONTROL_ALLOW_HEADERS</span>, <span class="ident">headers</span>.<span class="ident">clone</span>())); <span class="ident">res</span>.<span class="ident">insert_header</span>((<span class="ident">header::ACCESS_CONTROL_ALLOW_HEADERS</span>, <span class="ident">headers</span>.<span class="ident">clone</span>()));
} <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">headers</span>) <span class="op">=</span> } <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">headers</span>) <span class="op">=</span> <span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ACCESS_CONTROL_REQUEST_HEADERS</span>) {
<span class="ident">req</span>.<span class="ident">headers</span>().<span class="ident">get</span>(<span class="ident">header::ACCESS_CONTROL_REQUEST_HEADERS</span>)
{
<span class="comment">// all headers allowed, return</span> <span class="comment">// all headers allowed, return</span>
<span class="ident">res</span>.<span class="ident">insert_header</span>((<span class="ident">header::ACCESS_CONTROL_ALLOW_HEADERS</span>, <span class="ident">headers</span>.<span class="ident">clone</span>())); <span class="ident">res</span>.<span class="ident">insert_header</span>((<span class="ident">header::ACCESS_CONTROL_ALLOW_HEADERS</span>, <span class="ident">headers</span>.<span class="ident">clone</span>()));
} }
@ -296,10 +285,7 @@
<span class="ident">req</span>.<span class="ident">into_response</span>(<span class="ident">res</span>) <span class="ident">req</span>.<span class="ident">into_response</span>(<span class="ident">res</span>)
} }
<span class="kw">fn</span> <span class="ident">augment_response</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>( <span class="kw">fn</span> <span class="ident">augment_response</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>(<span class="ident">inner</span>: <span class="kw-2">&amp;</span><span class="ident">Inner</span>, <span class="kw-2">mut</span> <span class="ident">res</span>: <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span> {
<span class="ident">inner</span>: <span class="kw-2">&amp;</span><span class="ident">Inner</span>,
<span class="kw-2">mut</span> <span class="ident">res</span>: <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">access_control_allow_origin</span>(<span class="ident">res</span>.<span class="ident">request</span>().<span class="ident">head</span>()) { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">access_control_allow_origin</span>(<span class="ident">res</span>.<span class="ident">request</span>().<span class="ident">head</span>()) {
<span class="ident">res</span>.<span class="ident">headers_mut</span>() <span class="ident">res</span>.<span class="ident">headers_mut</span>()
.<span class="ident">insert</span>(<span class="ident">header::ACCESS_CONTROL_ALLOW_ORIGIN</span>, <span class="ident">origin</span>); .<span class="ident">insert</span>(<span class="ident">header::ACCESS_CONTROL_ALLOW_ORIGIN</span>, <span class="ident">origin</span>);

View File

@ -820,14 +820,6 @@
<span id="820">820</span> <span id="820">820</span>
<span id="821">821</span> <span id="821">821</span>
<span id="822">822</span> <span id="822">822</span>
<span id="823">823</span>
<span id="824">824</span>
<span id="825">825</span>
<span id="826">826</span>
<span id="827">827</span>
<span id="828">828</span>
<span id="829">829</span>
<span id="830">830</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">rc::Rc</span>, <span class="ident">time::SystemTime</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">rc::Rc</span>, <span class="ident">time::SystemTime</span>};
<span class="kw">use</span> <span class="ident">futures_util::future</span>::{<span class="ident">ready</span>, <span class="ident">Ready</span>}; <span class="kw">use</span> <span class="ident">futures_util::future</span>::{<span class="ident">ready</span>, <span class="ident">Ready</span>};
@ -1269,8 +1261,7 @@
<span class="kw">match</span> <span class="ident">login_timestamp</span> { <span class="kw">match</span> <span class="ident">login_timestamp</span> {
<span class="ident">LoginTimestampCheck::NoTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">login_timestamp</span>, <span class="prelude-val">None</span>), <span class="ident">LoginTimestampCheck::NoTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">login_timestamp</span>, <span class="prelude-val">None</span>),
<span class="ident">LoginTimestampCheck::NewTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert!</span>( <span class="ident">LoginTimestampCheck::NewTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert!</span>(
<span class="ident">t30sec_ago</span> <span class="op">&lt;</span><span class="op">=</span> <span class="ident">cv</span>.<span class="ident">login_timestamp</span>.<span class="ident">unwrap</span>() <span class="ident">t30sec_ago</span> <span class="op">&lt;</span><span class="op">=</span> <span class="ident">cv</span>.<span class="ident">login_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&amp;&amp;</span> <span class="ident">cv</span>.<span class="ident">login_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&lt;</span><span class="op">=</span> <span class="ident">now</span>
<span class="op">&amp;&amp;</span> <span class="ident">cv</span>.<span class="ident">login_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&lt;</span><span class="op">=</span> <span class="ident">now</span>
), ),
<span class="ident">LoginTimestampCheck::OldTimestamp</span>(<span class="ident">old_timestamp</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="ident">LoginTimestampCheck::OldTimestamp</span>(<span class="ident">old_timestamp</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">login_timestamp</span>, <span class="prelude-val">Some</span>(<span class="ident">old_timestamp</span>)) <span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">login_timestamp</span>, <span class="prelude-val">Some</span>(<span class="ident">old_timestamp</span>))
@ -1280,8 +1271,7 @@
<span class="kw">match</span> <span class="ident">visit_timestamp</span> { <span class="kw">match</span> <span class="ident">visit_timestamp</span> {
<span class="ident">VisitTimeStampCheck::NoTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">visit_timestamp</span>, <span class="prelude-val">None</span>), <span class="ident">VisitTimeStampCheck::NoTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert_eq!</span>(<span class="ident">cv</span>.<span class="ident">visit_timestamp</span>, <span class="prelude-val">None</span>),
<span class="ident">VisitTimeStampCheck::NewTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert!</span>( <span class="ident">VisitTimeStampCheck::NewTimestamp</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">assert!</span>(
<span class="ident">t30sec_ago</span> <span class="op">&lt;</span><span class="op">=</span> <span class="ident">cv</span>.<span class="ident">visit_timestamp</span>.<span class="ident">unwrap</span>() <span class="ident">t30sec_ago</span> <span class="op">&lt;</span><span class="op">=</span> <span class="ident">cv</span>.<span class="ident">visit_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&amp;&amp;</span> <span class="ident">cv</span>.<span class="ident">visit_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&lt;</span><span class="op">=</span> <span class="ident">now</span>
<span class="op">&amp;&amp;</span> <span class="ident">cv</span>.<span class="ident">visit_timestamp</span>.<span class="ident">unwrap</span>() <span class="op">&lt;</span><span class="op">=</span> <span class="ident">now</span>
), ),
} }
} }
@ -1318,12 +1308,10 @@
})), })),
) )
.<span class="kw">await</span>; .<span class="kw">await</span>;
<span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/index&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/index&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>); <span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>);
<span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>); <span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>);
<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>(); <span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>();
@ -1368,8 +1356,7 @@
) )
.<span class="kw">await</span>; .<span class="kw">await</span>;
<span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>); <span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>);
<span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>)); <span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>));
<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>(); <span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>();
@ -1395,8 +1382,7 @@
) )
.<span class="kw">await</span>; .<span class="kw">await</span>;
<span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>); <span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>);
<span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>)); <span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>));
@ -1458,8 +1444,7 @@
})), })),
) )
.<span class="kw">await</span>; .<span class="kw">await</span>;
<span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/login&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>); <span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::OK</span>);
<span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>)); <span class="macro">assert!</span>(<span class="ident">resp</span>.<span class="ident">headers</span>().<span class="ident">contains_key</span>(<span class="ident">header::SET_COOKIE</span>));
<span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>(); <span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">resp</span>.<span class="ident">response</span>().<span class="ident">cookies</span>().<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">to_owned</span>();
@ -1469,8 +1454,7 @@
<span class="attribute">#[<span class="ident">actix_rt::test</span>]</span> <span class="attribute">#[<span class="ident">actix_rt::test</span>]</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_identity_legacy_cookie_is_set</span>() { <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_identity_legacy_cookie_is_set</span>() {
<span class="kw">let</span> <span class="ident">srv</span> <span class="op">=</span> <span class="ident">create_identity_server</span>(<span class="op">|</span><span class="ident">c</span><span class="op">|</span> <span class="ident">c</span>).<span class="kw">await</span>; <span class="kw">let</span> <span class="ident">srv</span> <span class="op">=</span> <span class="ident">create_identity_server</span>(<span class="op">|</span><span class="ident">c</span><span class="op">|</span> <span class="ident">c</span>).<span class="kw">await</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">resp</span> <span class="op">=</span> <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">test::call_service</span>(<span class="kw-2">&amp;</span><span class="ident">srv</span>, <span class="ident">TestRequest::with_uri</span>(<span class="string">&quot;/&quot;</span>).<span class="ident">to_request</span>()).<span class="kw">await</span>;
<span class="ident">assert_legacy_login_cookie</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">resp</span>, <span class="ident">COOKIE_LOGIN</span>); <span class="ident">assert_legacy_login_cookie</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">resp</span>, <span class="ident">COOKIE_LOGIN</span>);
<span class="ident">assert_logged_in</span>(<span class="ident">resp</span>, <span class="prelude-val">None</span>).<span class="kw">await</span>; <span class="ident">assert_logged_in</span>(<span class="ident">resp</span>, <span class="prelude-val">None</span>).<span class="kw">await</span>;
} }

View File

@ -170,10 +170,6 @@
<span id="170">170</span> <span id="170">170</span>
<span id="171">171</span> <span id="171">171</span>
<span id="172">172</span> <span id="172">172</span>
<span id="173">173</span>
<span id="174">174</span>
<span id="175">175</span>
<span id="176">176</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix_web</span>::{ <span class="kw">use</span> <span class="ident">actix_web</span>::{
@ -181,9 +177,7 @@
<span class="ident">dev</span>::{<span class="ident">Service</span>, <span class="ident">ServiceRequest</span>, <span class="ident">ServiceResponse</span>, <span class="ident">Transform</span>}, <span class="ident">dev</span>::{<span class="ident">Service</span>, <span class="ident">ServiceRequest</span>, <span class="ident">ServiceResponse</span>, <span class="ident">Transform</span>},
<span class="ident">Error</span>, <span class="ident">HttpMessage</span>, <span class="prelude-ty">Result</span>, <span class="ident">Error</span>, <span class="ident">HttpMessage</span>, <span class="prelude-ty">Result</span>,
}; };
<span class="kw">use</span> <span class="ident">futures_util::future</span>::{ <span class="kw">use</span> <span class="ident">futures_util::future</span>::{<span class="ident">ready</span>, <span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>, <span class="ident">Ready</span>, <span class="ident">TryFutureExt</span> <span class="kw">as</span> <span class="kw">_</span>};
<span class="ident">ready</span>, <span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>, <span class="ident">Ready</span>, <span class="ident">TryFutureExt</span> <span class="kw">as</span> <span class="kw">_</span>,
};
<span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">identity::IdentityItem</span>, <span class="ident">IdentityPolicy</span>}; <span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">identity::IdentityItem</span>, <span class="ident">IdentityPolicy</span>};
@ -281,9 +275,7 @@
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">id</span>) <span class="op">=</span> <span class="ident">id</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">id</span>) <span class="op">=</span> <span class="ident">id</span> {
<span class="kw">match</span> <span class="ident">backend</span>.<span class="ident">to_response</span>(<span class="ident">id</span>.<span class="ident">id</span>, <span class="ident">id</span>.<span class="ident">changed</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">res</span>).<span class="kw">await</span> { <span class="kw">match</span> <span class="ident">backend</span>.<span class="ident">to_response</span>(<span class="ident">id</span>.<span class="ident">id</span>, <span class="ident">id</span>.<span class="ident">changed</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">res</span>).<span class="kw">await</span> {
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> { <span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_body</span>(<span class="op">|</span><span class="kw">_</span>, <span class="ident">body</span><span class="op">|</span> <span class="ident">AnyBody::from_message</span>(<span class="ident">body</span>))),
<span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">map_body</span>(<span class="op">|</span><span class="kw">_</span>, <span class="ident">body</span><span class="op">|</span> <span class="ident">AnyBody::from_message</span>(<span class="ident">body</span>)))
}
<span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">error_response</span>(<span class="ident">e</span>)), <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">res</span>.<span class="ident">error_response</span>(<span class="ident">e</span>)),
} }
} <span class="kw">else</span> { } <span class="kw">else</span> {

View File

@ -325,13 +325,6 @@
<span id="325">325</span> <span id="325">325</span>
<span id="326">326</span> <span id="326">326</span>
<span id="327">327</span> <span id="327">327</span>
<span id="328">328</span>
<span id="329">329</span>
<span id="330">330</span>
<span id="331">331</span>
<span id="332">332</span>
<span id="333">333</span>
<span id="334">334</span>
</pre><pre class="rust"><code><span class="attribute">#![<span class="ident">forbid</span>(<span class="ident">unsafe_code</span>)]</span> </pre><pre class="rust"><code><span class="attribute">#![<span class="ident">forbid</span>(<span class="ident">unsafe_code</span>)]</span>
<span class="attribute">#![<span class="ident">deny</span>(<span class="ident">rust_2018_idioms</span>, <span class="ident">nonstandard_style</span>)]</span> <span class="attribute">#![<span class="ident">deny</span>(<span class="ident">rust_2018_idioms</span>, <span class="ident">nonstandard_style</span>)]</span>
@ -348,17 +341,15 @@
<span class="ident">error::PayloadError</span>, <span class="ident">error::PayloadError</span>,
<span class="ident">http::header</span>::{<span class="ident">CONTENT_LENGTH</span>, <span class="ident">CONTENT_TYPE</span>}, <span class="ident">http::header</span>::{<span class="ident">CONTENT_LENGTH</span>, <span class="ident">CONTENT_TYPE</span>},
<span class="ident">web::BytesMut</span>, <span class="ident">web::BytesMut</span>,
<span class="ident">Error</span>, <span class="ident">FromRequest</span>, <span class="ident">HttpMessage</span>, <span class="ident">HttpRequest</span>, <span class="ident">HttpResponse</span>, <span class="ident">HttpResponseBuilder</span>, <span class="ident">Error</span>, <span class="ident">FromRequest</span>, <span class="ident">HttpMessage</span>, <span class="ident">HttpRequest</span>, <span class="ident">HttpResponse</span>, <span class="ident">HttpResponseBuilder</span>, <span class="ident">Responder</span>,
<span class="ident">Responder</span>, <span class="ident">ResponseError</span>, <span class="ident">ResponseError</span>,
}; };
<span class="kw">use</span> <span class="ident">derive_more::Display</span>; <span class="kw">use</span> <span class="ident">derive_more::Display</span>;
<span class="kw">use</span> <span class="ident">futures_util</span>::{ <span class="kw">use</span> <span class="ident">futures_util</span>::{
<span class="ident">future</span>::{<span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>}, <span class="ident">future</span>::{<span class="ident">FutureExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">LocalBoxFuture</span>},
<span class="ident">stream::StreamExt</span> <span class="kw">as</span> <span class="kw">_</span>, <span class="ident">stream::StreamExt</span> <span class="kw">as</span> <span class="kw">_</span>,
}; };
<span class="kw">use</span> <span class="ident">prost</span>::{ <span class="kw">use</span> <span class="ident">prost</span>::{<span class="ident">DecodeError</span> <span class="kw">as</span> <span class="ident">ProtoBufDecodeError</span>, <span class="ident">EncodeError</span> <span class="kw">as</span> <span class="ident">ProtoBufEncodeError</span>, <span class="ident">Message</span>};
<span class="ident">DecodeError</span> <span class="kw">as</span> <span class="ident">ProtoBufDecodeError</span>, <span class="ident">EncodeError</span> <span class="kw">as</span> <span class="ident">ProtoBufEncodeError</span>, <span class="ident">Message</span>,
};
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Display</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Display</span>)]</span>
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ProtoBufPayloadError</span> { <span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">ProtoBufPayloadError</span> {
@ -487,9 +478,7 @@
<span class="prelude-val">Ok</span>(()) <span class="op">=</span><span class="op">&gt;</span> <span class="ident">HttpResponse::Ok</span>() <span class="prelude-val">Ok</span>(()) <span class="op">=</span><span class="op">&gt;</span> <span class="ident">HttpResponse::Ok</span>()
.<span class="ident">content_type</span>(<span class="string">&quot;application/protobuf&quot;</span>) .<span class="ident">content_type</span>(<span class="string">&quot;application/protobuf&quot;</span>)
.<span class="ident">body</span>(<span class="ident">buf</span>), .<span class="ident">body</span>(<span class="ident">buf</span>),
<span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="ident">HttpResponse::from_error</span>(<span class="ident">Error::from</span>( <span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="ident">HttpResponse::from_error</span>(<span class="ident">Error::from</span>(<span class="ident">ProtoBufPayloadError::Serialize</span>(<span class="ident">err</span>))),
<span class="ident">ProtoBufPayloadError::Serialize</span>(<span class="ident">err</span>),
)),
} }
} }
} }
@ -543,10 +532,7 @@
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Message</span> <span class="op">+</span> <span class="ident">Default</span> <span class="op">+</span> <span class="lifetime">&#39;static</span><span class="op">&gt;</span> <span class="ident">Future</span> <span class="kw">for</span> <span class="ident">ProtoBufMessage</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> { <span class="kw">impl</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Message</span> <span class="op">+</span> <span class="ident">Default</span> <span class="op">+</span> <span class="lifetime">&#39;static</span><span class="op">&gt;</span> <span class="ident">Future</span> <span class="kw">for</span> <span class="ident">ProtoBufMessage</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> {
<span class="kw">type</span> <span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">T</span>, <span class="ident">ProtoBufPayloadError</span><span class="op">&gt;</span>; <span class="kw">type</span> <span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">T</span>, <span class="ident">ProtoBufPayloadError</span><span class="op">&gt;</span>;
<span class="kw">fn</span> <span class="ident">poll</span>( <span class="kw">fn</span> <span class="ident">poll</span>(<span class="kw-2">mut</span> <span class="self">self</span>: <span class="ident">Pin</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">Self</span><span class="op">&gt;</span>, <span class="ident">task</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">task::Context</span><span class="op">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Poll</span><span class="op">&lt;</span><span class="ident"><span class="self">Self</span>::Output</span><span class="op">&gt;</span> {
<span class="kw-2">mut</span> <span class="self">self</span>: <span class="ident">Pin</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">Self</span><span class="op">&gt;</span>,
<span class="ident">task</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">task::Context</span><span class="op">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Poll</span><span class="op">&lt;</span><span class="ident"><span class="self">Self</span>::Output</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">fut</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">fut</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">fut</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">fut</span> {
<span class="kw">return</span> <span class="ident">Pin::new</span>(<span class="ident">fut</span>).<span class="ident">poll</span>(<span class="ident">task</span>); <span class="kw">return</span> <span class="ident">Pin::new</span>(<span class="ident">fut</span>).<span class="ident">poll</span>(<span class="ident">task</span>);
} }

View File

@ -704,14 +704,6 @@
<span id="704">704</span> <span id="704">704</span>
<span id="705">705</span> <span id="705">705</span>
<span id="706">706</span> <span id="706">706</span>
<span id="707">707</span>
<span id="708">708</span>
<span id="709">709</span>
<span id="710">710</span>
<span id="711">711</span>
<span id="712">712</span>
<span id="713">713</span>
<span id="714">714</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashMap</span>, <span class="ident">iter</span>, <span class="ident">rc::Rc</span>}; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashMap</span>, <span class="ident">iter</span>, <span class="ident">rc::Rc</span>};
<span class="kw">use</span> <span class="ident">actix::prelude</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">actix::prelude</span>::<span class="kw-2">*</span>;
@ -947,9 +939,7 @@
<span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>); <span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
}; };
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cookie</span>) <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cookie</span>) <span class="op">=</span> <span class="ident">cookies</span>.<span class="ident">iter</span>().<span class="ident">find</span>(<span class="op">|</span><span class="kw-2">&amp;</span><span class="ident">cookie</span><span class="op">|</span> <span class="ident">cookie</span>.<span class="ident">name</span>() <span class="op">=</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">name</span>) {
<span class="ident">cookies</span>.<span class="ident">iter</span>().<span class="ident">find</span>(<span class="op">|</span><span class="kw-2">&amp;</span><span class="ident">cookie</span><span class="op">|</span> <span class="ident">cookie</span>.<span class="ident">name</span>() <span class="op">=</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">name</span>)
{
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">jar</span> <span class="op">=</span> <span class="ident">CookieJar::new</span>(); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">jar</span> <span class="op">=</span> <span class="ident">CookieJar::new</span>();
<span class="ident">jar</span>.<span class="ident">add_original</span>(<span class="ident">cookie</span>.<span class="ident">clone</span>()); <span class="ident">jar</span>.<span class="ident">add_original</span>(<span class="ident">cookie</span>.<span class="ident">clone</span>());
@ -1085,8 +1075,8 @@
<span class="ident">cookie</span>.<span class="ident">set_max_age</span>(<span class="ident">Duration::zero</span>()); <span class="ident">cookie</span>.<span class="ident">set_max_age</span>(<span class="ident">Duration::zero</span>());
<span class="ident">cookie</span>.<span class="ident">set_expires</span>(<span class="ident">OffsetDateTime::now_utc</span>() <span class="op">-</span> <span class="ident">Duration::days</span>(<span class="number">365</span>)); <span class="ident">cookie</span>.<span class="ident">set_expires</span>(<span class="ident">OffsetDateTime::now_utc</span>() <span class="op">-</span> <span class="ident">Duration::days</span>(<span class="number">365</span>));
<span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">HeaderValue::from_str</span>(<span class="kw-2">&amp;</span><span class="ident">cookie</span>.<span class="ident">to_string</span>()) <span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span>
.<span class="ident">map_err</span>(<span class="ident">error::ErrorInternalServerError</span>)<span class="question-mark">?</span>; <span class="ident">HeaderValue::from_str</span>(<span class="kw-2">&amp;</span><span class="ident">cookie</span>.<span class="ident">to_string</span>()).<span class="ident">map_err</span>(<span class="ident">error::ErrorInternalServerError</span>)<span class="question-mark">?</span>;
<span class="ident">res</span>.<span class="ident">headers_mut</span>().<span class="ident">append</span>(<span class="ident">header::SET_COOKIE</span>, <span class="ident">val</span>); <span class="ident">res</span>.<span class="ident">headers_mut</span>().<span class="ident">append</span>(<span class="ident">header::SET_COOKIE</span>, <span class="ident">val</span>);
<span class="prelude-val">Ok</span>(()) <span class="prelude-val">Ok</span>(())
@ -1137,10 +1127,7 @@
<span class="ident">user_id</span>: <span class="ident">String</span>, <span class="ident">user_id</span>: <span class="ident">String</span>,
} }
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">login</span>( <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">login</span>(<span class="ident">user_id</span>: <span class="ident">web::Json</span><span class="op">&lt;</span><span class="ident">Identity</span><span class="op">&gt;</span>, <span class="ident">session</span>: <span class="ident">Session</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">HttpResponse</span><span class="op">&gt;</span> {
<span class="ident">user_id</span>: <span class="ident">web::Json</span><span class="op">&lt;</span><span class="ident">Identity</span><span class="op">&gt;</span>,
<span class="ident">session</span>: <span class="ident">Session</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">HttpResponse</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">user_id</span>.<span class="ident">into_inner</span>().<span class="ident">user_id</span>; <span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">user_id</span>.<span class="ident">into_inner</span>().<span class="ident">user_id</span>;
<span class="ident">session</span>.<span class="ident">insert</span>(<span class="string">&quot;user_id&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">id</span>)<span class="question-mark">?</span>; <span class="ident">session</span>.<span class="ident">insert</span>(<span class="string">&quot;user_id&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">id</span>)<span class="question-mark">?</span>;
<span class="ident">session</span>.<span class="ident">renew</span>(); <span class="ident">session</span>.<span class="ident">renew</span>();
@ -1204,10 +1191,7 @@
<span class="kw">let</span> <span class="ident">srv</span> <span class="op">=</span> <span class="ident">actix_test::start</span>(<span class="op">|</span><span class="op">|</span> { <span class="kw">let</span> <span class="ident">srv</span> <span class="op">=</span> <span class="ident">actix_test::start</span>(<span class="op">|</span><span class="op">|</span> {
<span class="ident">App::new</span>() <span class="ident">App::new</span>()
.<span class="ident">wrap</span>( .<span class="ident">wrap</span>(<span class="ident">RedisSession::new</span>(<span class="string">&quot;127.0.0.1:6379&quot;</span>, <span class="kw-2">&amp;</span>[<span class="number">0</span>; <span class="number">32</span>]).<span class="ident">cookie_name</span>(<span class="string">&quot;test-session&quot;</span>))
<span class="ident">RedisSession::new</span>(<span class="string">&quot;127.0.0.1:6379&quot;</span>, <span class="kw-2">&amp;</span>[<span class="number">0</span>; <span class="number">32</span>])
.<span class="ident">cookie_name</span>(<span class="string">&quot;test-session&quot;</span>),
)
.<span class="ident">wrap</span>(<span class="ident">middleware::Logger::default</span>()) .<span class="ident">wrap</span>(<span class="ident">middleware::Logger::default</span>())
.<span class="ident">service</span>(<span class="ident">resource</span>(<span class="string">&quot;/&quot;</span>).<span class="ident">route</span>(<span class="ident">get</span>().<span class="ident">to</span>(<span class="ident">index</span>))) .<span class="ident">service</span>(<span class="ident">resource</span>(<span class="string">&quot;/&quot;</span>).<span class="ident">route</span>(<span class="ident">get</span>().<span class="ident">to</span>(<span class="ident">index</span>)))
.<span class="ident">service</span>(<span class="ident">resource</span>(<span class="string">&quot;/do_something&quot;</span>).<span class="ident">route</span>(<span class="ident">post</span>().<span class="ident">to</span>(<span class="ident">do_something</span>))) .<span class="ident">service</span>(<span class="ident">resource</span>(<span class="string">&quot;/do_something&quot;</span>).<span class="ident">route</span>(<span class="ident">post</span>().<span class="ident">to</span>(<span class="ident">do_something</span>)))

View File

@ -558,12 +558,6 @@
<span id="558">558</span> <span id="558">558</span>
<span id="559">559</span> <span id="559">559</span>
<span id="560">560</span> <span id="560">560</span>
<span id="561">561</span>
<span id="562">562</span>
<span id="563">563</span>
<span id="564">564</span>
<span id="565">565</span>
<span id="566">566</span>
</pre><pre class="rust"><code><span class="doccomment">//! Cookie based sessions. See docs for [`CookieSession`].</span> </pre><pre class="rust"><code><span class="doccomment">//! Cookie based sessions. See docs for [`CookieSession`].</span>
<span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashMap</span>, <span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>}; <span class="kw">use</span> <span class="ident">std</span>::{<span class="ident">collections::HashMap</span>, <span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">rc::Rc</span>};
@ -643,8 +637,7 @@
<span class="kw">return</span> <span class="prelude-val">Ok</span>(()); <span class="kw">return</span> <span class="prelude-val">Ok</span>(());
} }
<span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">serde_json::to_string</span>(<span class="kw-2">&amp;</span><span class="ident">state</span>).<span class="ident">map_err</span>(<span class="ident">CookieSessionError::Serialize</span>)<span class="question-mark">?</span>;
<span class="ident">serde_json::to_string</span>(<span class="kw-2">&amp;</span><span class="ident">state</span>).<span class="ident">map_err</span>(<span class="ident">CookieSessionError::Serialize</span>)<span class="question-mark">?</span>;
<span class="kw">if</span> <span class="ident">value</span>.<span class="ident">len</span>() <span class="op">&gt;</span> <span class="number">4064</span> { <span class="kw">if</span> <span class="ident">value</span>.<span class="ident">len</span>() <span class="op">&gt;</span> <span class="number">4064</span> {
<span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CookieSessionError::Overflow</span>.<span class="ident">into</span>()); <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">CookieSessionError::Overflow</span>.<span class="ident">into</span>());
@ -709,9 +702,7 @@
<span class="kw">let</span> <span class="ident">cookie_opt</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">security</span> { <span class="kw">let</span> <span class="ident">cookie_opt</span> <span class="op">=</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">security</span> {
<span class="ident">CookieSecurity::Signed</span> <span class="op">=</span><span class="op">&gt;</span> <span class="ident">jar</span>.<span class="ident">signed</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">key</span>).<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">name</span>), <span class="ident">CookieSecurity::Signed</span> <span class="op">=</span><span class="op">&gt;</span> <span class="ident">jar</span>.<span class="ident">signed</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">key</span>).<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">name</span>),
<span class="ident">CookieSecurity::Private</span> <span class="op">=</span><span class="op">&gt;</span> { <span class="ident">CookieSecurity::Private</span> <span class="op">=</span><span class="op">&gt;</span> <span class="ident">jar</span>.<span class="ident">private</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">key</span>).<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">name</span>),
<span class="ident">jar</span>.<span class="ident">private</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">key</span>).<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">name</span>)
}
}; };
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cookie</span>) <span class="op">=</span> <span class="ident">cookie_opt</span> { <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cookie</span>) <span class="op">=</span> <span class="ident">cookie_opt</span> {
@ -1094,10 +1085,7 @@
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">ses</span>.<span class="ident">insert</span>(<span class="string">&quot;counter&quot;</span>, <span class="number">100</span>); <span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">ses</span>.<span class="ident">insert</span>(<span class="string">&quot;counter&quot;</span>, <span class="number">100</span>);
<span class="string">&quot;test&quot;</span> <span class="string">&quot;test&quot;</span>
})) }))
.<span class="ident">service</span>( .<span class="ident">service</span>(<span class="ident">web::resource</span>(<span class="string">&quot;/test/&quot;</span>).<span class="ident">to</span>(<span class="op">|</span><span class="op">|</span> <span class="kw">async</span> <span class="kw">move</span> { <span class="string">&quot;no-changes-in-session&quot;</span> })),
<span class="ident">web::resource</span>(<span class="string">&quot;/test/&quot;</span>)
.<span class="ident">to</span>(<span class="op">|</span><span class="op">|</span> <span class="kw">async</span> <span class="kw">move</span> { <span class="string">&quot;no-changes-in-session&quot;</span> }),
),
) )
.<span class="kw">await</span>; .<span class="kw">await</span>;

View File

@ -399,16 +399,6 @@
<span id="399">399</span> <span id="399">399</span>
<span id="400">400</span> <span id="400">400</span>
<span id="401">401</span> <span id="401">401</span>
<span id="402">402</span>
<span id="403">403</span>
<span id="404">404</span>
<span id="405">405</span>
<span id="406">406</span>
<span id="407">407</span>
<span id="408">408</span>
<span id="409">409</span>
<span id="410">410</span>
<span id="411">411</span>
</pre><pre class="rust"><code><span class="doccomment">//! Sessions for Actix Web.</span> </pre><pre class="rust"><code><span class="doccomment">//! Sessions for Actix Web.</span>
<span class="doccomment">//!</span> <span class="doccomment">//!</span>
<span class="doccomment">//! Provides a general solution for session management. Session middleware could provide different</span> <span class="doccomment">//! Provides a general solution for session management. Session middleware could provide different</span>
@ -576,11 +566,7 @@
<span class="doccomment">///</span> <span class="doccomment">///</span>
<span class="doccomment">/// Any serializable value can be used and will be encoded as JSON in session data, hence why</span> <span class="doccomment">/// Any serializable value can be used and will be encoded as JSON in session data, hence why</span>
<span class="doccomment">/// only a reference to the value is taken.</span> <span class="doccomment">/// only a reference to the value is taken.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">insert</span>( <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">insert</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw">impl</span> <span class="ident">Into</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>, <span class="ident">value</span>: <span class="kw">impl</span> <span class="ident">Serialize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">Error</span><span class="op">&gt;</span> {
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">key</span>: <span class="kw">impl</span> <span class="ident">Into</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>,
<span class="ident">value</span>: <span class="kw">impl</span> <span class="ident">Serialize</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">Error</span><span class="op">&gt;</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">borrow_mut</span>(); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="number">0</span>.<span class="ident">borrow_mut</span>();
<span class="kw">if</span> <span class="ident">inner</span>.<span class="ident">status</span> <span class="op">!</span><span class="op">=</span> <span class="ident">SessionStatus::Purged</span> { <span class="kw">if</span> <span class="ident">inner</span>.<span class="ident">status</span> <span class="op">!</span><span class="op">=</span> <span class="ident">SessionStatus::Purged</span> {
@ -610,10 +596,7 @@
<span class="doccomment">///</span> <span class="doccomment">///</span>
<span class="doccomment">/// Returns None if key was not present in session. Returns T if deserialization succeeds,</span> <span class="doccomment">/// Returns None if key was not present in session. Returns T if deserialization succeeds,</span>
<span class="doccomment">/// otherwise returns un-deserialized JSON string.</span> <span class="doccomment">/// otherwise returns un-deserialized JSON string.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">remove_as</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">DeserializeOwned</span><span class="op">&gt;</span>( <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">remove_as</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">DeserializeOwned</span><span class="op">&gt;</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">T</span>, <span class="ident">String</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">T</span>, <span class="ident">String</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>) <span class="self">self</span>.<span class="ident">remove</span>(<span class="ident">key</span>)
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">val_str</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">serde_json::from_str</span>(<span class="kw-2">&amp;</span><span class="ident">val_str</span>) { .<span class="ident">map</span>(<span class="op">|</span><span class="ident">val_str</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">serde_json::from_str</span>(<span class="kw-2">&amp;</span><span class="ident">val_str</span>) {
<span class="prelude-val">Ok</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">val</span>), <span class="prelude-val">Ok</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Ok</span>(<span class="ident">val</span>),
@ -670,10 +653,7 @@
<span class="doccomment">/// vec![(&quot;counter&quot;.to_string(), serde_json::to_string(&amp;0).unwrap())],</span> <span class="doccomment">/// vec![(&quot;counter&quot;.to_string(), serde_json::to_string(&amp;0).unwrap())],</span>
<span class="doccomment">/// );</span> <span class="doccomment">/// );</span>
<span class="doccomment">/// ```</span> <span class="doccomment">/// ```</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set_session</span>( <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">set_session</span>(<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">ServiceRequest</span>, <span class="ident">data</span>: <span class="kw">impl</span> <span class="ident">IntoIterator</span><span class="op">&lt;</span><span class="ident">Item</span> <span class="op">=</span> (<span class="ident">String</span>, <span class="ident">String</span>)<span class="op">&gt;</span>) {
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">ServiceRequest</span>,
<span class="ident">data</span>: <span class="kw">impl</span> <span class="ident">IntoIterator</span><span class="op">&lt;</span><span class="ident">Item</span> <span class="op">=</span> (<span class="ident">String</span>, <span class="ident">String</span>)<span class="op">&gt;</span>,
) {
<span class="kw">let</span> <span class="ident">session</span> <span class="op">=</span> <span class="ident">Session::get_session</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="kw-2">*</span><span class="ident">req</span>.<span class="ident">extensions_mut</span>()); <span class="kw">let</span> <span class="ident">session</span> <span class="op">=</span> <span class="ident">Session::get_session</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="kw-2">*</span><span class="ident">req</span>.<span class="ident">extensions_mut</span>());
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="ident">session</span>.<span class="number">0</span>.<span class="ident">borrow_mut</span>(); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">inner</span> <span class="op">=</span> <span class="ident">session</span>.<span class="number">0</span>.<span class="ident">borrow_mut</span>();
<span class="ident">inner</span>.<span class="ident">state</span>.<span class="ident">extend</span>(<span class="ident">data</span>); <span class="ident">inner</span>.<span class="ident">state</span>.<span class="ident">extend</span>(<span class="ident">data</span>);

View File

@ -147,9 +147,6 @@
<span id="147">147</span> <span id="147">147</span>
<span id="148">148</span> <span id="148">148</span>
<span id="149">149</span> <span id="149">149</span>
<span id="150">150</span>
<span id="151">151</span>
<span id="152">152</span>
</pre><pre class="rust"><code><span class="doccomment">//! Extractor for the &quot;Basic&quot; HTTP Authentication Scheme</span> </pre><pre class="rust"><code><span class="doccomment">//! Extractor for the &quot;Basic&quot; HTTP Authentication Scheme</span>
<span class="kw">use</span> <span class="ident">std::borrow::Cow</span>; <span class="kw">use</span> <span class="ident">std::borrow::Cow</span>;
@ -260,10 +257,7 @@
<span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">Config</span>; <span class="kw">type</span> <span class="ident">Config</span> <span class="op">=</span> <span class="ident">Config</span>;
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">AuthenticationError</span><span class="op">&lt;</span><span class="ident">Challenge</span><span class="op">&gt;</span>; <span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">AuthenticationError</span><span class="op">&lt;</span><span class="ident">Challenge</span><span class="op">&gt;</span>;
<span class="kw">fn</span> <span class="ident">from_request</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="kw">_</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Payload</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="op">&lt;</span><span class="self">Self</span> <span class="kw">as</span> <span class="ident">FromRequest</span><span class="op">&gt;</span><span class="ident">::Future</span> {
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">HttpRequest</span>,
<span class="kw">_</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Payload</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="op">&lt;</span><span class="self">Self</span> <span class="kw">as</span> <span class="ident">FromRequest</span><span class="op">&gt;</span><span class="ident">::Future</span> {
<span class="ident">ready</span>( <span class="ident">ready</span>(
<span class="ident">Authorization</span>::<span class="op">&lt;</span><span class="ident">Basic</span><span class="op">&gt;</span><span class="ident">::parse</span>(<span class="ident">req</span>) <span class="ident">Authorization</span>::<span class="op">&lt;</span><span class="ident">Basic</span><span class="op">&gt;</span><span class="ident">::parse</span>(<span class="ident">req</span>)
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">auth</span><span class="op">|</span> <span class="ident">BasicAuth</span>(<span class="ident">auth</span>.<span class="ident">into_scheme</span>())) .<span class="ident">map</span>(<span class="op">|</span><span class="ident">auth</span><span class="op">|</span> <span class="ident">BasicAuth</span>(<span class="ident">auth</span>.<span class="ident">into_scheme</span>()))

View File

@ -175,9 +175,6 @@
<span id="175">175</span> <span id="175">175</span>
<span id="176">176</span> <span id="176">176</span>
<span id="177">177</span> <span id="177">177</span>
<span id="178">178</span>
<span id="179">179</span>
<span id="180">180</span>
</pre><pre class="rust"><code><span class="doccomment">//! Extractor for the &quot;Bearer&quot; HTTP Authentication Scheme</span> </pre><pre class="rust"><code><span class="doccomment">//! Extractor for the &quot;Bearer&quot; HTTP Authentication Scheme</span>
<span class="kw">use</span> <span class="ident">std::borrow::Cow</span>; <span class="kw">use</span> <span class="ident">std::borrow::Cow</span>;
@ -287,10 +284,7 @@
<span class="kw">type</span> <span class="ident">Future</span> <span class="op">=</span> <span class="ident">Ready</span><span class="op">&lt;</span><span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="self">Self</span>, <span class="ident"><span class="self">Self</span>::Error</span><span class="op">&gt;</span><span class="op">&gt;</span>; <span class="kw">type</span> <span class="ident">Future</span> <span class="op">=</span> <span class="ident">Ready</span><span class="op">&lt;</span><span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="self">Self</span>, <span class="ident"><span class="self">Self</span>::Error</span><span class="op">&gt;</span><span class="op">&gt;</span>;
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">AuthenticationError</span><span class="op">&lt;</span><span class="ident">bearer::Bearer</span><span class="op">&gt;</span>; <span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">AuthenticationError</span><span class="op">&lt;</span><span class="ident">bearer::Bearer</span><span class="op">&gt;</span>;
<span class="kw">fn</span> <span class="ident">from_request</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="ident">_payload</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Payload</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="op">&lt;</span><span class="self">Self</span> <span class="kw">as</span> <span class="ident">FromRequest</span><span class="op">&gt;</span><span class="ident">::Future</span> {
<span class="ident">req</span>: <span class="kw-2">&amp;</span><span class="ident">HttpRequest</span>,
<span class="ident">_payload</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Payload</span>,
) <span class="op">-</span><span class="op">&gt;</span> <span class="op">&lt;</span><span class="self">Self</span> <span class="kw">as</span> <span class="ident">FromRequest</span><span class="op">&gt;</span><span class="ident">::Future</span> {
<span class="ident">ready</span>( <span class="ident">ready</span>(
<span class="ident">authorization::Authorization</span>::<span class="op">&lt;</span><span class="ident">authorization::Bearer</span><span class="op">&gt;</span><span class="ident">::parse</span>(<span class="ident">req</span>) <span class="ident">authorization::Authorization</span>::<span class="op">&lt;</span><span class="ident">authorization::Bearer</span><span class="op">&gt;</span><span class="ident">::parse</span>(<span class="ident">req</span>)
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">auth</span><span class="op">|</span> <span class="ident">BearerAuth</span>(<span class="ident">auth</span>.<span class="ident">into_scheme</span>())) .<span class="ident">map</span>(<span class="op">|</span><span class="ident">auth</span><span class="op">|</span> <span class="ident">BearerAuth</span>(<span class="ident">auth</span>.<span class="ident">into_scheme</span>()))

View File

@ -99,14 +99,10 @@
<span id="99"> 99</span> <span id="99"> 99</span>
<span id="100">100</span> <span id="100">100</span>
<span id="101">101</span> <span id="101">101</span>
<span id="102">102</span>
<span id="103">103</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::fmt</span>; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
<span class="kw">use</span> <span class="ident">actix_web::error::ParseError</span>; <span class="kw">use</span> <span class="ident">actix_web::error::ParseError</span>;
<span class="kw">use</span> <span class="ident">actix_web::http::header</span>::{ <span class="kw">use</span> <span class="ident">actix_web::http::header</span>::{<span class="ident">Header</span>, <span class="ident">HeaderName</span>, <span class="ident">HeaderValue</span>, <span class="ident">IntoHeaderValue</span>, <span class="ident">AUTHORIZATION</span>};
<span class="ident">Header</span>, <span class="ident">HeaderName</span>, <span class="ident">HeaderValue</span>, <span class="ident">IntoHeaderValue</span>, <span class="ident">AUTHORIZATION</span>,
};
<span class="kw">use</span> <span class="ident">actix_web::HttpMessage</span>; <span class="kw">use</span> <span class="ident">actix_web::HttpMessage</span>;
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::headers::authorization::scheme::Scheme</span>; <span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::headers::authorization::scheme::Scheme</span>;

View File

@ -29,12 +29,8 @@
<span id="29">29</span> <span id="29">29</span>
<span id="30">30</span> <span id="30">30</span>
<span id="31">31</span> <span id="31">31</span>
<span id="32">32</span>
<span id="33">33</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">actix_web::error::ParseError</span>; </pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">actix_web::error::ParseError</span>;
<span class="kw">use</span> <span class="ident">actix_web::http::header</span>::{ <span class="kw">use</span> <span class="ident">actix_web::http::header</span>::{<span class="ident">Header</span>, <span class="ident">HeaderName</span>, <span class="ident">HeaderValue</span>, <span class="ident">IntoHeaderValue</span>, <span class="ident">WWW_AUTHENTICATE</span>};
<span class="ident">Header</span>, <span class="ident">HeaderName</span>, <span class="ident">HeaderValue</span>, <span class="ident">IntoHeaderValue</span>, <span class="ident">WWW_AUTHENTICATE</span>,
};
<span class="kw">use</span> <span class="ident">actix_web::HttpMessage</span>; <span class="kw">use</span> <span class="ident">actix_web::HttpMessage</span>;
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::Challenge</span>; <span class="kw">use</span> <span class="ident"><span class="kw">super</span>::Challenge</span>;

View File

@ -310,12 +310,10 @@
<span id="310">310</span> <span id="310">310</span>
<span id="311">311</span> <span id="311">311</span>
<span id="312">312</span> <span id="312">312</span>
<span id="313">313</span>
</pre><pre class="rust"><code><span class="doccomment">//! HTTP Authentication middleware.</span> </pre><pre class="rust"><code><span class="doccomment">//! HTTP Authentication middleware.</span>
<span class="kw">use</span> <span class="ident">std</span>::{ <span class="kw">use</span> <span class="ident">std</span>::{
<span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">future::Future</span>, <span class="ident">marker::PhantomData</span>, <span class="ident">pin::Pin</span>, <span class="ident">rc::Rc</span>, <span class="ident">error::Error</span> <span class="kw">as</span> <span class="ident">StdError</span>, <span class="ident">future::Future</span>, <span class="ident">marker::PhantomData</span>, <span class="ident">pin::Pin</span>, <span class="ident">rc::Rc</span>, <span class="ident">sync::Arc</span>,
<span class="ident">sync::Arc</span>,
}; };
<span class="kw">use</span> <span class="ident">actix_web</span>::{ <span class="kw">use</span> <span class="ident">actix_web</span>::{