1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +01:00
actix-extras/actix_cors/struct.Cors.html
2023-04-09 19:03:56 +00:00

151 lines
60 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Builder for CORS middleware."><title>Cors in actix_cors - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-63a85fc7cf22dee2.css" id="mainThemeStyle"><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="actix_cors" data-themes="" data-resource-suffix="" data-rustdoc-version="1.70.0-nightly (af06dce64 2023-04-08)" data-search-js="search-bc5a112813b5d712.js" data-settings-js="settings-298e1ea74db45b39.js" data-settings-css="settings-0bcba95ff279c1db.css" data-theme-light-css="light-db279b6232be9c13.css" data-theme-dark-css="dark-cf923f49f397b216.css" data-theme-ayu-css="ayu-be46fdc453a55015.css" ></div><script src="../static.files/storage-62ce34ea385b278a.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-1159a395118aa44e.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../static.files/light-db279b6232be9c13.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../static.files/dark-cf923f49f397b216.css"><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></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="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../actix_cors/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../actix_cors/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2 class="location"><a href="#">Cors</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.allow_any_header">allow_any_header</a></li><li><a href="#method.allow_any_method">allow_any_method</a></li><li><a href="#method.allow_any_origin">allow_any_origin</a></li><li><a href="#method.allow_private_network_access">allow_private_network_access</a></li><li><a href="#method.allowed_header">allowed_header</a></li><li><a href="#method.allowed_headers">allowed_headers</a></li><li><a href="#method.allowed_methods">allowed_methods</a></li><li><a href="#method.allowed_origin">allowed_origin</a></li><li><a href="#method.allowed_origin_fn">allowed_origin_fn</a></li><li><a href="#method.block_on_origin_mismatch">block_on_origin_mismatch</a></li><li><a href="#method.disable_preflight">disable_preflight</a></li><li><a href="#method.disable_vary_header">disable_vary_header</a></li><li><a href="#method.expose_any_header">expose_any_header</a></li><li><a href="#method.expose_headers">expose_headers</a></li><li><a href="#method.max_age">max_age</a></li><li><a href="#method.permissive">permissive</a></li><li><a href="#method.send_wildcard">send_wildcard</a></li><li><a href="#method.supports_credentials">supports_credentials</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Debug-for-Cors">Debug</a></li><li><a href="#impl-Default-for-Cors">Default</a></li><li><a href="#impl-Transform%3CS,+ServiceRequest%3E-for-Cors">Transform&lt;S, ServiceRequest&gt;</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-Cors">!RefUnwindSafe</a></li><li><a href="#impl-Send-for-Cors">!Send</a></li><li><a href="#impl-Sync-for-Cors">!Sync</a></li><li><a href="#impl-UnwindSafe-for-Cors">!UnwindSafe</a></li><li><a href="#impl-Unpin-for-Cors">Unpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-Cors">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-Cors">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-Cors">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-Cors">From&lt;T&gt;</a></li><li><a href="#impl-Instrument-for-Cors">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-Cors">Into&lt;U&gt;</a></li><li><a href="#impl-Same%3CT%3E-for-Cors">Same&lt;T&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-Cors">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-Cors">TryInto&lt;U&gt;</a></li><li><a href="#impl-VZip%3CV%3E-for-Cors">VZip&lt;V&gt;</a></li><li><a href="#impl-WithSubscriber-for-Cors">WithSubscriber</a></li></ul></section><h2><a href="index.html">In actix_cors</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="index.html">actix_cors</a>::<wbr><a class="struct" href="#">Cors</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/actix_cors/builder.rs.html#76-79">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub struct Cors { /* private fields */ }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Builder for CORS middleware.</p>
<p>To construct a CORS middleware, call <a href="struct.Cors.html#method.default" title="associated function actix_cors::Cors::default"><code>Cors::default()</code></a> to create a blank, restrictive builder.
Then use any of the builder methods to customize CORS behavior.</p>
<p>The alternative <a href="struct.Cors.html#method.permissive" title="associated function actix_cors::Cors::permissive"><code>Cors::permissive()</code></a> constructor is available for local development, allowing
all origins and headers, etc. <strong>The permissive constructor should not be used in production.</strong></p>
<h2 id="errors"><a href="#errors">Errors</a></h2>
<p>Errors surface in the middleware initialization phase. This means that, if you have logs enabled
in Actix Web (using <code>env_logger</code> or other crate that exposes logs from the <code>log</code> crate), error
messages will outline what is wrong with the CORS configuration in the server logs and the
server will fail to start up or serve requests.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>actix_cors::Cors;
<span class="kw">use </span>actix_web::http::header;
<span class="kw">let </span>cors = Cors::default()
.allowed_origin(<span class="string">&quot;https://www.rust-lang.org&quot;</span>)
.allowed_methods(<span class="macro">vec!</span>[<span class="string">&quot;GET&quot;</span>, <span class="string">&quot;POST&quot;</span>])
.allowed_headers(<span class="macro">vec!</span>[header::AUTHORIZATION, header::ACCEPT])
.allowed_header(header::CONTENT_TYPE)
.max_age(<span class="number">3600</span>);
<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><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Cors" class="impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#81-491">source</a><a href="#impl-Cors" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.permissive" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#86-114">source</a><h4 class="code-header">pub fn <a href="#method.permissive" class="fn">permissive</a>() -&gt; Self</h4></section></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.
Max age 1 hour. Does not send wildcard.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allow_any_origin" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#119-125">source</a><h4 class="code-header">pub fn <a href="#method.allow_any_origin" class="fn">allow_any_origin</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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="method actix_cors::Cors::allowed_origin"><code>Cors::allowed_origin</code></a> for more info on allowed origins.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allowed_origin" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#151-178">source</a><h4 class="code-header">pub fn <a href="#method.allowed_origin" class="fn">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></section></summary><div class="docblock"><p>Add an origin that is allowed to make requests.</p>
<p>This method allows specifying a finite set of origins to verify the value of the <code>Origin</code>
request header. These are <code>origin-or-null</code> types in the <a href="https://fetch.spec.whatwg.org/#origin-header">Fetch Standard</a>.</p>
<p>By default, no origins are accepted.</p>
<p>When this list is set, the clients <code>Origin</code> request header will be checked in a
case-sensitive manner.</p>
<p>When all origins are allowed and <code>send_wildcard</code> is set, <code>*</code> will be sent in the
<code>Access-Control-Allow-Origin</code> response header. If <code>send_wildcard</code> is not set, the clients
<code>Origin</code> request header will be echoed back in the <code>Access-Control-Allow-Origin</code>
response header.</p>
<p>If the origin of the request doesnt match any allowed origins and at least one
<code>allowed_origin_fn</code> function is set, these functions will be used to determinate
allowed origins.</p>
<h5 id="initialization-errors"><a href="#initialization-errors">Initialization Errors</a></h5>
<ul>
<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="method actix_cors::Cors::send_wildcard"><code>Cors::send_wildcard</code></a> should be used instead.</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allowed_origin_fn" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#188-199">source</a><h4 class="code-header">pub fn <a href="#method.allowed_origin_fn" class="fn">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
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.9/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,</span></h4></section></summary><div class="docblock"><p>Determinate allowed origins by processing requests which didnt match any origins specified
in the <code>allowed_origin</code>.</p>
<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>
<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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allow_any_method" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#204-210">source</a><h4 class="code-header">pub fn <a href="#method.allow_any_method" class="fn">allow_any_method</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></summary><div class="docblock"><p>Resets allowed methods list to all methods.</p>
<p>See <a href="struct.Cors.html#method.allowed_methods" title="method actix_cors::Cors::allowed_methods"><code>Cors::allowed_methods</code></a> for more info on allowed methods.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allowed_methods" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#220-242">source</a><h4 class="code-header">pub fn <a href="#method.allowed_methods" class="fn">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
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;,
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.9/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;,
&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.9/http/method/struct.Method.html" title="struct http::method::Method">Method</a>&gt;&gt;::<a class="associatedtype" 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.9/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,</span></h4></section></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
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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allow_any_header" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#247-253">source</a><h4 class="code-header">pub fn <a href="#method.allow_any_header" class="fn">allow_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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="method actix_cors::Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allowed_header" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#258-280">source</a><h4 class="code-header">pub fn <a href="#method.allowed_header" class="fn">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
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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,
&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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="associatedtype" 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.9/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,</span></h4></section></summary><div class="docblock"><p>Add an allowed request header.</p>
<p>See <a href="struct.Cors.html#method.allowed_headers" title="method actix_cors::Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allowed_headers" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#292-319">source</a><h4 class="code-header">pub fn <a href="#method.allowed_headers" class="fn">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
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;,
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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,
&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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="associatedtype" 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.9/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,</span></h4></section></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>
<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
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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.expose_any_header" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#324-330">source</a><h4 class="code-header">pub fn <a href="#method.expose_any_header" class="fn">expose_any_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></summary><div class="docblock"><p>Resets exposed response header list to a state where all headers are exposed.</p>
<p>See <a href="struct.Cors.html#method.expose_headers" title="method actix_cors::Cors::expose_headers"><code>Cors::expose_headers</code></a> for more info on exposed response headers.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.expose_headers" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#339-365">source</a><h4 class="code-header">pub fn <a href="#method.expose_headers" class="fn">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
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;,
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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;,
&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.9/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>&gt;&gt;::<a class="associatedtype" 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.9/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>&gt;,</span></h4></section></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
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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.max_age" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#373-379">source</a><h4 class="code-header">pub fn <a href="#method.max_age" class="fn">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></section></summary><div class="docblock"><p>Set a maximum time (in seconds) for which this CORS request may be cached. 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>
<p>Pass a number (of seconds) or use None to disable sending max age header.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.send_wildcard" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#392-398">source</a><h4 class="code-header">pub fn <a href="#method.send_wildcard" class="fn">send_wildcard</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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
<code>Access-Control-Allow-Origin</code> response header is sent, rather than the requests
<code>Origin</code> header.</p>
<p>This <strong>CANNOT</strong> be used in conjunction with <code>allowed_origins</code> set to <code>All</code> and
<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>
<p>Defaults to <code>false</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.supports_credentials" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#415-421">source</a><h4 class="code-header">pub fn <a href="#method.supports_credentials" class="fn">supports_credentials</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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
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>
<p>This option cannot be used in conjunction with an <code>allowed_origin</code> set to <code>All</code> and
<code>send_wildcards</code> set to <code>true</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
to send wildcards (<code>*</code>); this is not allowed by the CORS protocol.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.allow_private_network_access" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#434-440">source</a><h4 class="code-header">pub fn <a href="#method.allow_private_network_access" class="fn">allow_private_network_access</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></summary><div class="docblock"><p>Allow private network access.</p>
<p>If true, injects the <code>Access-Control-Allow-Private-Network: true</code> header in responses if the
request contained the <code>Access-Control-Request-Private-Network: true</code> header.</p>
<p>For more information on this behavior, see the draft <a href="https://wicg.github.io/private-network-access">Private Network Access</a> spec.</p>
<p>Defaults to <code>false</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.disable_vary_header" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#452-458">source</a><h4 class="code-header">pub fn <a href="#method.disable_vary_header" class="fn">disable_vary_header</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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
implementation guidelines.</p>
<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)
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>
</div></details><details class="toggle method-toggle" open><summary><section id="method.disable_preflight" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#466-472">source</a><h4 class="code-header">pub fn <a href="#method.disable_preflight" class="fn">disable_preflight</a>(self) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></summary><div class="docblock"><p>Disable support for preflight requests.</p>
<p>When enabled CORS middleware automatically handles <code>OPTIONS</code> requests.
This is useful for application level middleware.</p>
<p>By default <em>preflight</em> support is enabled.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.block_on_origin_mismatch" class="method"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#484-490">source</a><h4 class="code-header">pub fn <a href="#method.block_on_origin_mismatch" class="fn">block_on_origin_mismatch</a>(self, block: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></summary><div class="docblock"><p>Configures whether requests should be pre-emptively blocked on mismatched origin.</p>
<p>If <code>true</code>, a 400 Bad Request is returned immediately when a request fails origin validation.</p>
<p>If <code>false</code>, the request will be processed as normal but relevant CORS headers will not be
appended to the response. In this case, the browser is trusted to validate CORS headers and
and block requests based on pre-flight requests. Use this setting to allow cURL and other
non-browser HTTP clients to function as normal, no matter what <code>Origin</code> the request has.</p>
<p>Defaults to <code>true</code>.</p>
</div></details></div></details></div><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="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Cors" class="impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#75">source</a><a href="#impl-Debug-for-Cors" class="anchor">§</a><h3 class="code-header">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></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#75">source</a><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="fn">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></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-Cors" class="impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#493-527">source</a><a href="#impl-Default-for-Cors" class="anchor">§</a><h3 class="code-header">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></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#498-526">source</a><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="fn">default</a>() -&gt; <a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a></h4></section></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
not supported. No max age (will use browsers default).</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Transform%3CS,+ServiceRequest%3E-for-Cors" class="impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#529-588">source</a><a href="#impl-Transform%3CS,+ServiceRequest%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;S, B&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
S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt;,
S::Future: 'static,
B: MessageBody + 'static,</span></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Response" class="associatedtype trait-impl"><a href="#associatedtype.Response" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Response</a> = ServiceResponse&lt;EitherBody&lt;B, BoxBody&gt;&gt;</h4></section></summary><div class='docblock'>Responses produced by the service.</div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Error</a> = Error</h4></section></summary><div class='docblock'>Errors produced by the service.</div></details><details class="toggle" open><summary><section id="associatedtype.InitError" class="associatedtype trait-impl"><a href="#associatedtype.InitError" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section></summary><div class='docblock'>Errors produced while building a transform service.</div></details><details class="toggle" open><summary><section id="associatedtype.Transform" class="associatedtype trait-impl"><a href="#associatedtype.Transform" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Transform</a> = CorsMiddleware&lt;S&gt;</h4></section></summary><div class='docblock'>The <code>TransformService</code> value created by this factory</div></details><details class="toggle" open><summary><section id="associatedtype.Future" class="associatedtype trait-impl"><a href="#associatedtype.Future" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">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;&lt;<a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> as Transform&lt;S, ServiceRequest&gt;&gt;::Transform, &lt;<a class="struct" href="struct.Cors.html" title="struct actix_cors::Cors">Cors</a> as Transform&lt;S, ServiceRequest&gt;&gt;::InitError&gt;&gt;</h4></section></summary><div class='docblock'>The future response value.</div></details><details class="toggle method-toggle" open><summary><section id="method.new_transform" class="method trait-impl"><a class="srclink rightside" href="../src/actix_cors/builder.rs.html#542-587">source</a><a href="#method.new_transform" class="anchor">§</a><h4 class="code-header">fn <a class="fn">new_transform</a>(&amp;self, service: S) -&gt; Self::Future</h4></section></summary><div class='docblock'>Creates and returns a new Transform component, asynchronously</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"><section id="impl-RefUnwindSafe-for-Cors" class="impl"><a href="#impl-RefUnwindSafe-for-Cors" class="anchor">§</a><h3 class="code-header">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></section><section id="impl-Send-for-Cors" class="impl"><a href="#impl-Send-for-Cors" class="anchor">§</a><h3 class="code-header">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></section><section id="impl-Sync-for-Cors" class="impl"><a href="#impl-Sync-for-Cors" class="anchor">§</a><h3 class="code-header">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></section><section id="impl-Unpin-for-Cors" class="impl"><a href="#impl-Unpin-for-Cors" class="anchor">§</a><h3 class="code-header">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></section><section id="impl-UnwindSafe-for-Cors" class="impl"><a href="#impl-UnwindSafe-for-Cors" class="anchor">§</a><h3 class="code-header">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></section></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="toggle implementors-toggle"><summary><section id="impl-Any-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#200">source</a><a href="#impl-Any-for-Cors" class="anchor">§</a><h3 class="code-header">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
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#201">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">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></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#impl-Borrow%3CT%3E-for-Cors" class="anchor">§</a><h3 class="code-header">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
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213">source</a></span><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220">source</a><a href="#impl-BorrowMut%3CT%3E-for-Cors" class="anchor">§</a><h3 class="code-header">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
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">source</a></span><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>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></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#734">source</a><a href="#impl-From%3CT%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#737">source</a></span><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Instrument-for-Cors" class="impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276">source</a><a href="#impl-Instrument-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82">source</a><a href="#method.instrument" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument" class="fn">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the provided <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="struct tracing::span::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121">source</a><a href="#method.in_current_span" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fn">in_current_span</a>(self) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Instruments this type with the <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current" title="associated function tracing::span::Span::current">current</a> <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="struct tracing::span::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<span class="where fmt-newline">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#726">source</a></span><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Same%3CT%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://docs.rs/typenum/1.16.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same%3CT%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777">source</a><a href="#impl-TryFrom%3CU%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<span class="where fmt-newline">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#784">source</a></span><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-Cors" class="impl"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#761">source</a><a href="#impl-TryInto%3CU%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<span class="where fmt-newline">where
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#768">source</a></span><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-Cors" class="impl"><a href="#impl-VZip%3CV%3E-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;V, T&gt; VZip&lt;V&gt; for T<span class="where fmt-newline">where
V: MultiLane&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl"><a href="#method.vzip" class="anchor">§</a><h4 class="code-header">fn <a class="fn">vzip</a>(self) -&gt; V</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-Cors" class="impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#334">source</a><a href="#impl-WithSubscriber-for-Cors" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html" title="trait tracing::instrument::WithSubscriber">WithSubscriber</a> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#169-171">source</a><a href="#method.with_subscriber" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber" class="fn">with_subscriber</a>&lt;S&gt;(self, subscriber: S) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a>&lt;Self&gt;<span class="where fmt-newline">where
S: <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/tracing-core/0.1.22/tracing_core/dispatcher/struct.Dispatch.html" title="struct tracing_core::dispatcher::Dispatch">Dispatch</a>&gt;,</span></h4></section></summary><div class='docblock'>Attaches the provided <a href="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221">source</a><a href="#method.with_current_subscriber" class="anchor">§</a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" class="fn">with_current_subscriber</a>(self) -&gt; <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Attaches the current <a href="https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber" title="mod tracing::dispatcher">default</a> <a href="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details></div></section></div></main></body></html>