<!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="A handle representing a span, with the capability to enter the span if it exists."><title>Span in tracing - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-dd39b87e5fcfba68.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="tracing"data-themes=""data-resource-suffix=""data-rustdoc-version="1.80.0 (051478957 2024-07-21)"data-channel="1.80.0"data-search-js="search-d52510db62a78183.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../static.files/storage-118b08c4c78b968e.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-20a3ad099b048cf2.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-df360f571f6edeae.css"></noscript><linkrel="alternate icon"type="image/png"href="../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../static.files/favicon-2c020d218678b618.svg"></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"title="show sidebar"></button><aclass="logo-container"href="../tracing/index.html"><imgsrc="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png"alt=""></a></nav><navclass="sidebar"><divclass="sidebar-crate"><aclass="logo-container"href="../tracing/index.html"><imgsrc="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png"alt="logo"></a><h2><ahref="../tracing/index.html">tracing</a><spanclass="version">0.1.40</span></h2></div><h2class="location"><ahref="#">Span</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.child_of">child_of</a></li><li><ahref="#method.current">current</a></li><li><ahref="#method.enter">enter</a></li><li><ahref="#method.entered">entered</a></li><li><ahref="#method.field">field</a></li><li><ahref="#method.follows_from">follows_from</a></li><li><ahref="#method.has_field">has_field</a></li><li><ahref="#method.id">id</a></li><li><ahref="#method.in_scope">in_scope</a></li><li><ahref="#method.is_disabled">is_disabled</a></li><li><ahref="#method.is_none">is_none</a></li><li><ahref="#method.metadata">metadata</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.new_disabled">new_disabled</a></li><li><ahref="#method.new_root">new_root</a></li><li><ahref="#method.none">none</a></li><li><ahref="#method.or_current">or_current</a></li><li><ahref="#method.record">record</a></li><li><ahref="#method.record_all">record_all</a></li><li><ahref="#method.with_subscriber">with_subscriber</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Clone-for-Span">Clone</a></li><li><ahref="#impl-Debug-for-Span">Debug</a></li><li><ahref="#impl-Drop-for-Span">Drop</a></li><li><ahref="#impl-From%3C%26Span%3E-for-Option%3C%26Id%3E">From<&'a Span></a></li><li><ahref="#impl-From%3C%26Span%3E-for-Option%3CId%3E">From<&'a Span></a></li><li><ahref="#impl-From%3CSpan%3E-for-Option%3CId%3E">From<Span></a></li><li><ahref="#im
<p>If the span was rejected by the current <code>Subscriber</code>’s filter, entering the
span will silently do nothing. Thus, the handle can be used in the same
manner regardless of whether or not the trace is currently being collected.</p>
</div></details><h2id="implementations"class="section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Span"class="impl"><aclass="src rightside"href="../src/tracing/span.rs.html#422-1373">source</a><ahref="#impl-Span"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#436-438">source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>(meta: &'static <aclass="struct"href="struct.Metadata.html"title="struct tracing::Metadata">Metadata</a><'static>, values: &<aclass="struct"href="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">ValueSet</a><'_>) -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Constructs a new <code>Span</code> with the given <ahref="struct.Metadata.html"title="struct tracing::Metadata">metadata</a> and set of
<p>The new span will be constructed by the currently-active <ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a>,
with the current span as its parent (if one exists).</p>
<p>After the span is constructed, <ahref="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">field values</a> and/or <ahref="struct.Span.html#method.follows_from"title="method tracing::Span::follows_from"><code>follows_from</code></a>
annotations may be added to it.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.new_root"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#460-462">source</a><h4class="code-header">pub fn <ahref="#method.new_root"class="fn">new_root</a>(meta: &'static <aclass="struct"href="struct.Metadata.html"title="struct tracing::Metadata">Metadata</a><'static>, values: &<aclass="struct"href="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">ValueSet</a><'_>) -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Constructs a new <code>Span</code> as the root of its own trace tree, with the
given <ahref="struct.Metadata.html"title="struct tracing::Metadata">metadata</a> and set of <ahref="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">field values</a>.</p>
<p>After the span is constructed, <ahref="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">field values</a> and/or <ahref="struct.Span.html#method.follows_from"title="method tracing::Span::follows_from"><code>follows_from</code></a>
) -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Constructs a new <code>Span</code> as child of the given parent span, with the
given <ahref="struct.Metadata.html"title="struct tracing::Metadata">metadata</a> and set of <ahref="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">field values</a>.</p>
<p>After the span is constructed, <ahref="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">field values</a> and/or <ahref="struct.Span.html#method.follows_from"title="method tracing::Span::follows_from"><code>follows_from</code></a>
annotations may be added to it.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.new_disabled"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#519-524">source</a><h4class="code-header">pub fn <ahref="#method.new_disabled"class="fn">new_disabled</a>(meta: &'static <aclass="struct"href="struct.Metadata.html"title="struct tracing::Metadata">Metadata</a><'static>) -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Constructs a new disabled span with the given <code>Metadata</code>.</p>
<p>This should be used when a span is constructed from a known callsite,
but the subscriber indicates that it is disabled.</p>
<p>Entering, exiting, and recording values on this span will not notify the
<code>Subscriber</code> but <em>may</em> record log messages if the <code>log</code> feature flag is
enabled.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.none"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#533-538">source</a><h4class="code-header">pub const fn <ahref="#method.none"class="fn">none</a>() -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Constructs a new span that is <em>completely disabled</em>.</p>
<p>This can be used rather than <code>Option<Span></code> to represent cases where a
span is not present.</p>
<p>Entering, exiting, and recording values on this span will do nothing.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.current"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#549-561">source</a><h4class="code-header">pub fn <ahref="#method.current"class="fn">current</a>() -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass="docblock"><p>Returns a handle to the span <ahref="trait.Subscriber.html#method.current_span"title="method tracing::Subscriber::current_span">considered by the <code>Subscriber</code></a> to be the
current span.</p>
<p>If the subscriber indicates that it does not track the current span, or
that the thread from which this function is called is not currently
inside a span, the returned span will be disabled.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.enter"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#785-788">source</a><h4class="code-header">pub fn <ahref="#method.enter"class="fn">enter</a>(&self) -><aclass="struct"href="span/struct.Entered.html"title="struct tracing::span::Entered">Entered</a><'_></h4></section></summary><divclass="docblock"><p>Enters this span, returning a guard that will exit the span when dropped.</p>
<p>If this span is enabled by the current subscriber, then this function will
call <ahref="trait.Subscriber.html#tymethod.enter"title="method tracing::Subscriber::enter"><code>Subscriber::enter</code></a> with the span’s <ahref="span/struct.Id.html"title="struct tracing::span::Id"><code>Id</code></a>, and dropping the guard
will call <ahref="trait.Subscriber.html#tymethod.exit"title="method tracing::Subscriber::exit"><code>Subscriber::exit</code></a>. If the span is disabled, this does
<p><strong>Warning</strong>: in asynchronous code that uses <ahref="https://rust-lang.github.io/async-book/01_getting_started/04_async_await_primer.html">async/await syntax</a>,
<code>Span::enter</code> should be used very carefully or avoided entirely. Holding
the drop guard returned by <code>Span::enter</code> across <code>.await</code> points will
<p>The drop guard returned by <code>Span::enter</code> exits the span when it is
dropped. When an async function or async block yields at an <code>.await</code>
point, the current scope is <em>exited</em>, but values in that scope are
<strong>not</strong> dropped (because the async block will eventually resume
execution from that await point). This means that <em>another</em> task will
begin executing while <em>remaining</em> in the entered span. This results in
an incorrect trace.</p>
<p>Instead of using <code>Span::enter</code> in asynchronous code, prefer the
following:</p>
<ul>
<li>
<p>To enter a span for a synchronous section of code within an async
block or function, prefer <ahref="struct.Span.html#method.in_scope"title="method tracing::Span::in_scope"><code>Span::in_scope</code></a>. Since <code>in_scope</code> takes a
synchronous closure and exits the span when the closure returns, the
span will always be exited before the next await point. For example:</p>
<p>For instrumenting asynchronous code, <code>tracing</code> provides the
<ahref="trait.Instrument.html"title="trait tracing::Instrument"><code>Future::instrument</code> combinator</a> for
attaching a span to a future (async function or block). This will
enter the span <em>every</em> time the future is polled, and exit it whenever
the future yields.</p>
<p><code>Instrument</code> can be used with an async block inside an async function:</p>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="kw">use </span>tracing::Instrument;
<spanclass="comment">//more asynchronous code inside the span...
</span>}
<spanclass="comment">// instrument the async block with the span...
</span>.instrument(span)
<spanclass="comment">// ...and await it.
</span>.<spanclass="kw">await
</span>}</code></pre></div>
<p>It can also be used to instrument calls to async functions at the
callsite:</p>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="kw">use </span>tracing::Instrument;
<p>The <ahref="attr.instrument.html"title="attr tracing::instrument"><code>#[instrument]</code> attribute macro</a> can automatically generate
correct code when used on an async function:</p>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="attr">#[tracing::instrument(level = <spanclass="string">"info"</span>)]
<spanclass="comment">// this event occurs inside the span.
</span><spanclass="macro">info!</span>(<spanclass="string">"i'm in the span!"</span>);
<spanclass="comment">// exiting the scope drops the guard, exiting the span.
</span>}
<spanclass="comment">// this event is not inside the span.
</span><spanclass="macro">info!</span>(<spanclass="string">"i'm outside the span!"</span>)</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.entered"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#896-902">source</a><h4class="code-header">pub fn <ahref="#method.entered"class="fn">entered</a>(self) -><aclass="struct"href="span/struct.EnteredSpan.html"title="struct tracing::span::EnteredSpan">EnteredSpan</a></h4></section></summary><divclass="docblock"><p>Enters this span, consuming it and returning a <ahref="span/struct.EnteredSpan.html"title="struct tracing::span::EnteredSpan">guard</a>
<strong>Warning</strong>: In asynchronous code that uses async/await syntax,
<code>Span::entered</code> may produce incorrect traces if the returned drop
guard is held across an await point. See <ahref="#in-asynchronous-code">the
<code>Span::enter</code> documentation</a> for details.
</pre>
<p>If this span is enabled by the current subscriber, then this function will
call <ahref="trait.Subscriber.html#tymethod.enter"title="method tracing::Subscriber::enter"><code>Subscriber::enter</code></a> with the span’s <ahref="span/struct.Id.html"title="struct tracing::span::Id"><code>Id</code></a>, and dropping the guard
will call <ahref="trait.Subscriber.html#tymethod.exit"title="method tracing::Subscriber::exit"><code>Subscriber::exit</code></a>. If the span is disabled, this does
nothing.</p>
<p>This is similar to the <ahref="struct.Span.html#method.enter"title="method tracing::Span::enter"><code>Span::enter</code></a> method, except that it moves the
span by value into the returned guard, rather than borrowing it.
Therefore, this method can be used to create and enter a span in a
single expression, without requiring a <code>let</code>-binding. For example:</p>
<p>Since the <ahref="span/struct.EnteredSpan.html"title="struct tracing::span::EnteredSpan"><code>EnteredSpan</code></a> guard can dereference to the <ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a> itself,
the span may still be accessed while entered. For example:</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.or_current"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1027-1032">source</a><h4class="code-header">pub fn <ahref="#method.or_current"class="fn">or_current</a>(self) -> Self</h4></section></summary><divclass="docblock"><p>Returns this span, if it was <ahref="trait.Subscriber.html#tymethod.enabled"title="method tracing::Subscriber::enabled">enabled</a> by the current <ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a>, or
the <ahref="struct.Span.html#method.current"title="associated function tracing::Span::current">current span</a> (whose lexical distance may be further than expected),
if this span <ahref="struct.Span.html#method.is_disabled"title="method tracing::Span::is_disabled">is disabled</a>.</p>
<p>This method can be useful when propagating spans to spawned threads or
<spanclass="macro">tracing::info!</span>(<spanclass="string">"spawned a thread!"</span>);
<spanclass="comment">// ...
</span>});</code></pre></div>
<p>If the current <ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a> enables the <ahref="struct.Level.html#associatedconstant.DEBUG"title="associated constant tracing::Level::DEBUG"><code>DEBUG</code></a> level, then both
the “parent” and “child” spans will be enabled. Thus, when the “spawaned
a thread!” event occurs, it will be inside of the “child” span. Because
“parent” is the parent of “child”, the event will <em>also</em> be inside of
“parent”.</p>
<p>However, if the <ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a> only enables the <ahref="struct.Level.html#associatedconstant.INFO"title="associated constant tracing::Level::INFO"><code>INFO</code></a> level, the “child”
span will be disabled. When the thread is spawned, the
<code>child_span.entered()</code> call will do nothing, since “child” is not
enabled. In this case, the “spawned a thread!” event occurs outside of
<em>any</em> span, since the “child” span was responsible for propagating its
parent to the spawned thread.</p>
<p>If this is not the desired behavior, <code>Span::or_current</code> can be used to
ensure that the “parent” span is propagated in both cases, either as a
parent of “child” <em>or</em> directly. For example:</p>
be used similarly, in combination with <ahref="trait.Instrument.html#method.instrument"title="method tracing::Instrument::instrument"><code>instrument</code></a>:</p>
<spanclass="macro">tracing::info!</span>(<spanclass="string">"spawned a task!"</span>);
<spanclass="comment">// ...
</span>}.instrument(child_span.or_current())
);</code></pre></div>
<p>In general, <code>or_current</code> should be preferred over nesting an
<ahref="trait.Instrument.html#method.instrument"title="method tracing::Instrument::instrument"><code>instrument</code></a> call inside of an <ahref="trait.Instrument.html#method.in_current_span"title="method tracing::Instrument::in_current_span"><code>in_current_span</code></a> call, as using
<code>or_current</code> will be more efficient.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.in_scope"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1100-1103">source</a><h4class="code-header">pub fn <ahref="#method.in_scope"class="fn">in_scope</a><F: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>() -> T, T>(&self, f: F) -> T</h4></section></summary><divclass="docblock"><p>Executes the given function in the context of this span.</p>
Q: <aclass="trait"href="field/trait.AsField.html"title="trait tracing::field::AsField">AsField</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass="docblock"><p>Returns a <ahref="field/struct.Field.html"title="struct tracing::field::Field"><code>Field</code></a> for the field with the
Q: <aclass="trait"href="field/trait.AsField.html"title="trait tracing::field::AsField">AsField</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass="docblock"><p>Returns true if this <code>Span</code> has a field for the given
V: <aclass="trait"href="trait.Value.html"title="trait tracing::Value">Value</a>,</div></h4></section></summary><divclass="docblock"><p>Records that the field described by <code>field</code> has the value <code>value</code>.</p>
<p>This may be used with <ahref="field/struct.Empty.html"title="struct tracing::field::Empty"><code>field::Empty</code></a> to declare fields whose values
are not known when the span is created, and record them later:</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.record_all"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1213-1235">source</a><h4class="code-header">pub fn <ahref="#method.record_all"class="fn">record_all</a>(&self, values: &<aclass="struct"href="field/struct.ValueSet.html"title="struct tracing::field::ValueSet">ValueSet</a><'_>) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a></h4></section></summary><divclass="docblock"><p>Records all the fields in the provided <code>ValueSet</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_disabled"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1244-1246">source</a><h4class="code-header">pub fn <ahref="#method.is_disabled"class="fn">is_disabled</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if this span was disabled by the subscriber and does not
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_none"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1259-1261">source</a><h4class="code-header">pub fn <ahref="#method.is_none"class="fn">is_none</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if this span was constructed by <ahref="struct.Span.html#method.none"title="associated function tracing::Span::none"><code>Span::none</code></a> and is
<p>If <code>is_none</code> returns <code>true</code> for a given span, then <ahref="struct.Span.html#method.is_disabled"title="method tracing::Span::is_disabled"><code>is_disabled</code></a> will
also return <code>true</code>. However, when a span is disabled by the subscriber
rather than constructed by <code>Span::none</code>, this method will return
<code>false</code>, while <code>is_disabled</code> will return <code>true</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.follows_from"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1310-1317">source</a><h4class="code-header">pub fn <ahref="#method.follows_from"class="fn">follows_from</a>(&self, from: impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="span/struct.Id.html"title="struct tracing::span::Id">Id</a>>>) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a></h4></section></summary><divclass="docblock"><p>Indicates that the span with the given ID has an indirect causal
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.id"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1320-1322">source</a><h4class="code-header">pub fn <ahref="#method.id"class="fn">id</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="span/struct.Id.html"title="struct tracing::span::Id">Id</a>></h4></section></summary><divclass="docblock"><p>Returns this span’s <code>Id</code>, if it is enabled.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.metadata"class="method"><aclass="src rightside"href="../src/tracing/span.rs.html#1325-1327">source</a><h4class="code-header">pub fn <ahref="#method.metadata"class="fn">metadata</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'static <aclass="struct"href="struct.Metadata.html"title="struct tracing::Metadata">Metadata</a><'static>></h4></section></summary><divclass="docblock"><p>Returns this span’s <code>Metadata</code>, if it is enabled.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><T></h4></section></summary><divclass="docblock"><p>Invokes a function with a reference to this span’s ID and subscriber.</p>
</div></details></div></details></div><h2id="trait-implementations"class="section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Clone-for-Span"class="impl"><aclass="src rightside"href="../src/tracing/span.rs.html#347">source</a><ahref="#impl-Clone-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone"class="method trait-impl"><aclass="src rightside"href="../src/tracing/span.rs.html#347">source</a><ahref="#method.clone"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html#tymethod.clone"class="fn">clone</a>(&self) -><aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h4></section></summary><divclass='docblock'>Returns a copy of the value. <ahref="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_from"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.80.0/src/core/clone.rs.html#169">source</a></span><ahref="#method.clone_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html#method.clone_from"class="fn">clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>)</h4></section></summary><divclass='docblock'>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Debug-for-Span"class="impl"><aclass="src rightside"href="../src/tracing/span.rs.html#1392-1423">source</a><ahref="#impl-Debug-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl"><aclass="src rightside"href="../src/tracing/span.rs.html#1393-1422">source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.80.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.80.0/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></h4></section></summary><divclass='docblock'>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/1.80.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Drop-for-Span"class="impl"><aclass="src rightside"href="../src/tracing/span.rs.html#1455-1476">source</a><ahref="#impl-Drop-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html"title="trait core::ops::drop::Drop">Drop</a> for <aclass="struct"href="struct.Span.html"title="structtracing:
Self: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass='docblock'>Feeds a slice of this type into the given <ahref="https://doc.rust-lang.org/1.80.0/core/hash/trait.Hasher.html"title="trait core::hash::Hasher"><code>Hasher</code></a>. <ahref="https://doc.rust-lang.org/1.80.0/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq-for-Span"class="impl"><aclass="src rightside"href="../src/tracing/span.rs.html#1375-1384">source</a><ahref="#impl-PartialEq-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl"><aclass="src rightside"href="../src/tracing/span.rs.html#1376-1383">source</a><ahref="#method.eq"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#263">source</a></span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details></div><h2id="synthetic-implementations"class="section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-Freeze-for-Span"class="impl"><ahref="#impl-Freeze-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Freeze.html"title="trait core::marker::Freeze">Freeze</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section><sectionid="impl-RefUnwindSafe-for-Span"class="impl"><ahref="#impl-RefUnwindSafe-for-Span"class="anchor">§</a><h3class="code-header">impl !<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/panic/unwind_safe/trait.RefUnwindSafe.html"title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section><sectionid="impl-Send-for-Span"class="impl"><ahref="#impl-Send-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section><sectionid="impl-Sync-for-Span"class="impl"><ahref="#impl-Sync-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section><sectionid="impl-Unpin-for-Span"class="impl"><ahref="#impl-Unpin-for-Span"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section><sectionid="impl-UnwindSafe-for-Span"class="impl"><ahref="#impl-UnwindSafe-for-Span"class="anchor">§</a><h3class="code-header">impl !<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/panic/unwind_safe/trait.UnwindSafe.html"title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a></h3></section></div><h2id="blanket-implementations"class="section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor">§</a></h2><divid="blanket-implementations-list"><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Any-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/any.rs.html#140">source</a><ahref="#impl-Any-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T<divclass="where">where
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></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/1.80.0/src/core/any.rs.html#141">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.80.0/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/1.80.0/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-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#208">source</a><ahref="#impl-Borrow%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></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/1.80.0/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.80.0/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-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#216">source</a><ahref="#impl-BorrowMut%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></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/1.80.0/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/1.80.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.80.0/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-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#765">source</a><ahref="#impl-From%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.80.0/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-3"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#768">source</a><ahref="#method.from-3"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/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-T"class="impl"><aclass="src rightside"href="../src/tracing/instrument.rs.html#325">source</a><ahref="#impl-Instrument-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="trait.Instrument.html"title="trait tracing::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="../src/tracing/instrument.rs.html#86-91">source</a><ahref="#method.instrument"class="anchor">§</a><h4class="code-header">fn <ahref="trait.Instrument.html#method.instrument"class="fn">instrument</a>(self, span: <aclass="struct"href="struct.Span.html"title="struct tracing::Span">Span</a>) -><aclass="struct"href="instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self><ahref="#"class="tooltip"data-notable-ty="Instrumented<Self>">ⓘ</a></h4></section></summary><divclass='docblock'>Instruments this type with the provided <ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <ahref="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="../src/tracing/instrument.rs.html#128-130">source</a><ahref="#method.in_current_span"class="anchor">§</a><h4class="code-header">fn <ahref="trait.Instrument.html#method.in_current_span"class="fn">in_current_span</a>(self) -><aclass="struct"href="instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self><ahref="#"class="tooltip"data-notable-ty="Instrumented<Self>">ⓘ</a></h4></section></summary><divclass='docblock'>Instruments this type with the <ahref="struct.Span.html#method.current"title="associated function tracing::Span::current">current</a><ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a>, returning an
<code><ahref="https://doc.rust-lang.org/1.80.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-ToOwned-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/alloc/borrow.rs.html#83-85">source</a><ahref="#impl-ToOwned-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Owned"class="associatedtype trait-impl"><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="associatedtype">Owned</a> = T</h4></section></summary><divclass='docblock'>The resulting type after obtaining ownership.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_owned"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/alloc/borrow.rs.html#88">source</a><ahref="#method.to_owned"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fn">to_owned</a>(&self) -> T</h4></section></summary><divclass='docblock'>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/alloc/borrow.rs.html#92">source</a><ahref="#method.clone_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fn">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><divclass='docblock'>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/1.80.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#805-807">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.80.0/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/1.80.0/src/core/convert/mod.rs.html#812">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.80.0/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-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#790-792">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></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/1.80.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.80.0/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/1.80.0/src/core/convert/mod.rs.html#797">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.80.0/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-WithSubscriber-for-T"class="impl"><aclass="src rightside"href="../src/tracing/instrument.rs.html#393">source</a><ahref="#impl-WithSubscriber-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="instrument/trait.WithSubscriber.html"title="trait tracing::instrument::WithSubscriber">WithSubscriber</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_subscriber-1"class="method trait-impl"><aclass="src rightside"href="../src/tracing/instrument.rs.html#176-184">source</a><ahref="#method.with_subscriber-1"class="anchor">§</a><h4class="code-header">fn <ahref="instrument/trait.WithSubscriber.html#method.with_subscriber"class="fn">with_subscriber</a><S>(self, subscriber: S) -><aclass="struct"href="instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self><ahref="#"class="tooltip"data-notable-ty="WithDispatch<Self>">ⓘ</a><divclass="where">where
S: <aclass="trait"href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="struct.Dispatch.html"title="struct tracing::Dispatch">Dispatch</a>>,</div></h4></section></summary><divclass='docblock'>Attaches the provided <ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a> to this type, returning a
<ahref="instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="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="../src/tracing/instrument.rs.html#228-233">source</a><ahref="#method.with_current_subscriber"class="anchor">§</a><h4class="code-header">fn <ahref="instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fn">with_current_subscriber</a>(self) -><aclass="struct"href="instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self><ahref="#"class="tooltip"data-notable-ty="WithDispatch<Self>">ⓘ</a></h4></section></summary><divclass='docblock'>Attaches the current <ahref="dispatcher/index.html#setting-the-default-subscriber"title="mod tracing::dispatcher">default</a><ahref="trait.Subscriber.html"title="trait tracing::Subscriber"><code>Subscriber</code></a> to this type, returning a