<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="Builder for CORS middleware."><title>Cors in actix_cors - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-fa3bb1812debf86c.css"><metaname="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.74.0-nightly (3223b0b5e 2023-09-20)"data-channel="nightly"data-search-js="search-8be46b629f5f14a8.js"data-settings-js="settings-74424d7eec62a23e.js"><scriptsrc="../static.files/storage-fec3eaa3851e447d.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-c5bd66d33317d69f.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><linkrel="icon"href="https://actix.rs/favicon.ico"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="logo-container"href="../actix_cors/index.html"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></a></nav><navclass="sidebar"><aclass="logo-container"href="../actix_cors/index.html"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></a><h2class="location"><ahref="#">Cors</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block"><li><ahref="#method.allow_any_header">allow_any_header</a></li><li><ahref="#method.allow_any_method">allow_any_method</a></li><li><ahref="#method.allow_any_origin">allow_any_origin</a></li><li><ahref="#method.allow_private_network_access">allow_private_network_access</a></li><li><ahref="#method.allowed_header">allowed_header</a></li><li><ahref="#method.allowed_headers">allowed_headers</a></li><li><ahref="#method.allowed_methods">allowed_methods</a></li><li><ahref="#method.allowed_origin">allowed_origin</a></li><li><ahref="#method.allowed_origin_fn">allowed_origin_fn</a></li><li><ahref="#method.block_on_origin_mismatch">block_on_origin_mismatch</a></li><li><ahref="#method.disable_preflight">disable_preflight</a></li><li><ahref="#method.disable_vary_header">disable_vary_header</a></li><li><ahref="#method.expose_any_header">expose_any_header</a></li><li><ahref="#method.expose_headers">expose_headers</a></li><li><ahref="#method.max_age">max_age</a></li><li><ahref="#method.permissive">permissive</a></li><li><ahref="#method.send_wildcard">send_wildcard</a></li><li><ahref="#method.supports_credentials">supports_credentials</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block"><li><ahref="#impl-Debug-for-Cors">Debug</a></li><li><ahref="#impl-Default-for-Cors">Default</a></li><li><ahref="#impl-Transform%3CS,+ServiceRequest%3E-for-Cors">Transform<S, ServiceRequest></a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block"><li><ahref="#impl-RefUnwi
<p>To construct a CORS middleware, call <ahref="struct.Cors.html#method.default"title="associated function actix_cors::Cors::default"><code>Cors::default()</code></a> to create a blank, restrictive builder.
<p>The alternative <ahref="struct.Cors.html#method.permissive"title="associated function actix_cors::Cors::permissive"><code>Cors::permissive()</code></a> constructor is available for local development, allowing
</div></details><h2id="implementations"class="small-section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Cors"class="impl"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#81-491">source</a><ahref="#impl-Cors"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.permissive"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#86-114">source</a><h4class="code-header">pub fn <ahref="#method.permissive"class="fn">permissive</a>() -> Self</h4></section></summary><divclass="docblock"><p>A very permissive set of default for quick development. Not recommended for production use.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.allow_any_origin"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#119-125">source</a><h4class="code-header">pub fn <ahref="#method.allow_any_origin"class="fn">allow_any_origin</a>(self) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="docblock"><p>Resets allowed origin list to a state where any origin is accepted.</p>
<p>See <ahref="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><detailsclass="toggle method-toggle"open><summary><sectionid="method.allowed_origin"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#151-178">source</a><h4class="code-header">pub fn <ahref="#method.allowed_origin"class="fn">allowed_origin</a>(self, origin: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="docblock"><p>Add an origin that is allowed to make requests.</p>
<li>If supplied origin is a wildcard (<code>*</code>). <ahref="struct.Cors.html#method.send_wildcard"title="method actix_cors::Cors::send_wildcard"><code>Cors::send_wildcard</code></a> should be used instead.</li>
F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html"title="trait core::ops::function::Fn">Fn</a>(&<aclass="struct"href="https://docs.rs/http/0.2.9/http/header/value/struct.HeaderValue.html"title="struct http::header::value::HeaderValue">HeaderValue</a>, &RequestHead) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> + 'static,</span></h4></section></summary><divclass="docblock"><p>Determinate allowed origins by processing requests which didn’t match any origins specified
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.allow_any_method"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#204-210">source</a><h4class="code-header">pub fn <ahref="#method.allow_any_method"class="fn">allow_any_method</a>(self) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="docblock"><p>Resets allowed methods list to all methods.</p>
<p>See <ahref="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>
<M as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/method/struct.Method.html"title="struct http::method::Method">Method</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"title="type core::convert::TryInto::Error">Error</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/error/struct.Error.html"title="struct http::error::Error">HttpError</a>>,</span></h4></section></summary><divclass="docblock"><p>Set a list of methods which allowed origins can perform.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.allow_any_header"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#247-253">source</a><h4class="code-header">pub fn <ahref="#method.allow_any_header"class="fn">allow_any_header</a>(self) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="docblock"><p>Resets allowed request header list to a state where any header is accepted.</p>
<p>See <ahref="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>
<H as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/header/name/struct.HeaderName.html"title="struct http::header::name::HeaderName">HeaderName</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"title="type core::convert::TryInto::Error">Error</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/error/struct.Error.html"title="struct http::error::Error">HttpError</a>>,</span></h4></section></summary><divclass="docblock"><p>Add an allowed request header.</p>
<p>See <ahref="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>
<H as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/header/name/struct.HeaderName.html"title="struct http::header::name::HeaderName">HeaderName</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"title="type core::convert::TryInto::Error">Error</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/error/struct.Error.html"title="struct http::error::Error">HttpError</a>>,</span></h4></section></summary><divclass="docblock"><p>Set a list of request header field names which can be used when this resource is accessed by
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.expose_any_header"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#324-330">source</a><h4class="code-header">pub fn <ahref="#method.expose_any_header"class="fn">expose_any_header</a>(self) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="docblock"><p>Resets exposed response header list to a state where all headers are exposed.</p>
<p>See <ahref="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>
<H as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/header/name/struct.HeaderName.html"title="struct http::header::name::HeaderName">HeaderName</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"title="type core::convert::TryInto::Error">Error</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://docs.rs/http/0.2.9/http/error/struct.Error.html"title="struct http::error::Error">HttpError</a>>,</span></h4></section></summary><divclass="docblock"><p>Set a list of headers which are safe to expose to the API of a CORS API specification.
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max_age"class="method"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#373-379">source</a><h4class="code-header">pub fn <ahref="#method.max_age"class="fn">max_age</a>(self, max_age: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>>>) -><aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h4></section></summary><divclass="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 <ahref="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
B: MessageBody + 'static,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Response"class="associatedtype trait-impl"><ahref="#associatedtype.Response"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Response</a> = ServiceResponse<EitherBody<B, BoxBody>></h4></section></summary><divclass='docblock'>Responses produced by the service.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Error</a> = Error</h4></section></summary><divclass='docblock'>Errors produced by the service.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.InitError"class="associatedtype trait-impl"><ahref="#associatedtype.InitError"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">InitError</a> = <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section></summary><divclass='docblock'>Errors produced while building a transform service.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Transform"class="associatedtype trait-impl"><ahref="#associatedtype.Transform"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Transform</a> = CorsMiddleware<S></h4></section></summary><divclass='docblock'>The <code>TransformService</code> value created by this factory</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.Future"class="associatedtype trait-impl"><ahref="#associatedtype.Future"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Future</a> = Ready<<aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<<aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a> as Transform<S, ServiceRequest>>::Transform, <<aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a> as Transform<S, ServiceRequest>>::InitError>></h4></section></summary><divclass='docblock'>The future response value.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.new_transform"class="method trait-impl"><aclass="src rightside"href="../src/actix_cors/builder.rs.html#542-587">source</a><ahref="#method.new_transform"class="anchor">§</a><h4class="code-header">fn <aclass="fn">new_transform</a>(&self, service: S) -> Self::Future</h4></section></summary><divclass='docblock'>Creates and returns a new Transform component, asynchronously</div></details></div></details></div><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-RefUnwindSafe-for-Cors"class="impl"><ahref="#impl-RefUnwindSafe-for-Cors"class="anchor">§</a><h3class="code-header">impl !<aclass="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 <aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h3></section><sectionid="impl-Send-for-Cors"class="impl"><ahref="#impl-Send-for-Cors"class="anchor">§</a><h3class="code-header">impl !<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Cors.html"title="struct actix_cors::Cors">Cors</a></h3></section><sectionid="impl-Sync-for-Cors"class="impl"><ahref="#impl-Sync-for-Cors"class="anchor">§</a><h3class="code-header">impl !<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">S
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#136">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-Cors"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208">source</a><ahref="#impl-Borrow%3CT%3E-for-Cors"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<spanclass="where fmt-newline">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-Cors"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216">source</a><ahref="#impl-BorrowMut%3CT%3E-for-Cors"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<spanclass="where fmt-newline">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217">source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-Cors"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#722">source</a><ahref="#impl-From%3CT%3E-for-Cors"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from"class="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Instrument-for-Cors"class="impl"><aclass="src rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276">source</a><ahref="#impl-Instrument-for-Cors"class="anchor">§</a><h3class="code-header">impl<T><aclass="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><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.instrument"class="method trait-impl"><aclass="src rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82">source</a><ahref="#method.instrument"class="anchor">§</a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument"class="fn">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the provided <ahref="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. <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method trait-impl"><aclass="src rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121">source</a><ahref="#method.in_current_span"class="anchor">§</a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span"class="fn">in_current_span</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the <ahref="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current"title="associated function tracing::span::Span::current">current</a><ahref="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"title="struct tracing::span::Span"><code>Span</code></a>, returning an
<code><ahref="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-2"class="associatedtype trait-impl"><ahref="#associatedtype.Error-2"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#769">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="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><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-Cors"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#747">source</a><ahref="#impl-TryInto%3CU%3E-for-Cors"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<spanclass="where fmt-newline">where
U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="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><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#754">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="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><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-VZip%3CV%3E-for-Cors"class="impl"><ahref="#impl-VZip%3CV%3E-for-Cors"class="anchor">§</a><h3class="code-header">impl<V, T> VZip<V> for T<spanclass="where fmt-newline">where
S: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><Dispatch>,</span></h4></section></summary><divclass='docblock'>Attaches the provided <ahref="super::Subscriber"><code>Subscriber</code></a> to this type, returning a
<ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl"><aclass="src rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221">source</a><ahref="#method.with_current_subscriber"class="anchor">§</a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fn">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'>Attaches the current <ahref="https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber"title="mod tracing::dispatcher">default</a><ahref="super::Subscriber"><code>Subscriber</code></a> to this type, returning a