}</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Attaches spans to a <ahref="https://doc.rust-lang.org/1.80.0/core/future/future/trait.Future.html"title="trait core::future::future::Future"><code>std::future::Future</code></a>.</p>
instrumented with a <code>tracing</code><ahref="struct.Span.html"title="struct tracing::Span">span</a>.</p>
</div></details><h2id="provided-methods"class="section-header">Provided Methods<ahref="#provided-methods"class="anchor">§</a></h2><divclass="methods"><detailsclass="toggle method-toggle"open><summary><sectionid="method.instrument"class="method"><aclass="src rightside"href="../src/tracing/instrument.rs.html#86-91">source</a><h4class="code-header">fn <ahref="#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"><p>Instruments this type with the provided <ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper.</p>
<p>The attached <ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a> will be <ahref="struct.Span.html#method.enter"title="method tracing::Span::enter">entered</a> every time the instrumented
<ahref="https://doc.rust-lang.org/1.80.0/core/future/future/trait.Future.html"title="trait core::future::future::Future"><code>Future</code></a> is polled or <ahref="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html"title="trait core::ops::drop::Drop"><code>Drop</code></a>ped.</p>
<p>The <ahref="struct.Span.html#method.or_current"title="method tracing::Span::or_current"><code>Span::or_current</code></a> combinator can be used in combination with
<code>instrument</code> to ensure that the <ahref="struct.Span.html#method.current"title="associated function tracing::Span::current">current span</a> is attached to the
future if the span passed to <code>instrument</code> is <ahref="struct.Span.html#method.is_disabled"title="method tracing::Span::is_disabled">disabled</a>:</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method"><aclass="src rightside"href="../src/tracing/instrument.rs.html#128-130">source</a><h4class="code-header">fn <ahref="#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"><p>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>Instrumented</code> wrapper.</p>
<p>The attached <ahref="struct.Span.html"title="struct tracing::Span"><code>Span</code></a> will be <ahref="struct.Span.html#method.enter"title="method tracing::Span::enter">entered</a> every time the instrumented
<ahref="https://doc.rust-lang.org/1.80.0/core/future/future/trait.Future.html"title="trait core::future::future::Future"><code>Future</code></a> is polled or <ahref="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html"title="trait core::ops::drop::Drop"><code>Drop</code></a>ped.</p>