Initial docs commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<!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="Sets the subscriber as the default for the duration of the lifetime of the returned `DefaultGuard`"><meta name="keywords" content="rust, rustlang, rust-lang, set_default"><title>tracing::subscriber::set_default - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="set_default" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="fn" href="">set_default</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing/subscriber.rs.html#61-66" title="goto source code">[src]</a></span></h1><pre class="rust fn"><span class="docblock attributes">#[must_use = "Dropping the guard unregisters the subscriber."]</span>pub fn set_default<S>(subscriber: S) -> <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a> <span class="where fmt-newline">where<br> S: <a class="trait" href="../../tracing/trait.Subscriber.html" title="trait tracing::Subscriber">Subscriber</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static, </span></pre><div class="docblock"><p>Sets the subscriber as the default for the duration of the lifetime of the
|
||||
returned <a href="../dispatcher/struct.DefaultGuard.html"><code>DefaultGuard</code></a></p>
|
||||
<p>The default subscriber is used when creating a new <a href="../span/struct.Span.html"><code>Span</code></a> or
|
||||
<a href=":../event/struct.Event.html"><code>Event</code></a>, <em>if no span is currently executing</em>. If a span is currently
|
||||
executing, new spans or events are dispatched to the subscriber that
|
||||
tagged that span, instead.</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!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="Sets this subscriber as the global default for the duration of the entire program. Will be used as a fallback if no thread-local subscriber has been set in a thread (using `with_default`.)"><meta name="keywords" content="rust, rustlang, rust-lang, set_global_default"><title>tracing::subscriber::set_global_default - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="set_global_default" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="fn" href="">set_global_default</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing/subscriber.rs.html#39-44" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub fn set_global_default<S>(subscriber: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a>> <span class="where fmt-newline">where<br> S: <a class="trait" href="../../tracing/trait.Subscriber.html" title="trait tracing::Subscriber">Subscriber</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static, </span></pre><div class="docblock"><p>Sets this subscriber as the global default for the duration of the entire program.
|
||||
Will be used as a fallback if no thread-local subscriber has been set in a thread (using <code>with_default</code>.)</p>
|
||||
<p>Can only be set once; subsequent attempts to set the global default will fail.
|
||||
Returns whether the initialization was successful.</p>
|
||||
<p>Note: Libraries should <em>NOT</em> call <code>set_global_default()</code>! That will cause conflicts when
|
||||
executables try to set them later.</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!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="Sets this subscriber as the default for the duration of a closure."><meta name="keywords" content="rust, rustlang, rust-lang, with_default"><title>tracing::subscriber::with_default - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="with_default" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="fn" href="">with_default</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing/subscriber.rs.html#20-25" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub fn with_default<T, S>(subscriber: S, f: impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>() -> T) -> T <span class="where fmt-newline">where<br> S: <a class="trait" href="../../tracing/trait.Subscriber.html" title="trait tracing::Subscriber">Subscriber</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static, </span></pre><div class="docblock"><p>Sets this subscriber as the default for the duration of a closure.</p>
|
||||
<p>The default subscriber is used when creating a new <a href="../span/struct.Span.html"><code>Span</code></a> or
|
||||
<a href=":../event/struct.Event.html"><code>Event</code></a>, <em>if no span is currently executing</em>. If a span is currently
|
||||
executing, new spans or events are dispatched to the subscriber that
|
||||
tagged that span, instead.</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!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="Collects and records trace data."><meta name="keywords" content="rust, rustlang, rust-lang, subscriber"><title>tracing::subscriber - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><p class="location">Module subscriber</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">tracing</a></p><div id="sidebar-vars" data-name="subscriber" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">tracing</a>::<wbr><a class="mod" href="">subscriber</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing/subscriber.rs.html#1-68" title="goto source code">[src]</a></span></h1><div class="docblock"><p>Collects and records trace data.</p>
|
||||
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.DefaultGuard.html" title="tracing::subscriber::DefaultGuard struct">DefaultGuard</a></td><td class="docblock-short"><p>A guard that resets the current default dispatcher to the prior
|
||||
default dispatcher when dropped.</p>
|
||||
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Interest.html" title="tracing::subscriber::Interest struct">Interest</a></td><td class="docblock-short"><p>Indicates a <a href="../trait.Subscriber.html"><code>Subscriber</code></a>’s interest in a particular callsite.</p>
|
||||
</td></tr><tr class="module-item"><td><a class="struct" href="struct.SetGlobalDefaultError.html" title="tracing::subscriber::SetGlobalDefaultError struct">SetGlobalDefaultError</a></td><td class="docblock-short"><p>Returned if setting the global dispatcher fails.</p>
|
||||
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
|
||||
<table><tr class="module-item"><td><a class="trait" href="trait.Subscriber.html" title="tracing::subscriber::Subscriber trait">Subscriber</a></td><td class="docblock-short"><p>Trait representing the functions required to collect trace data.</p>
|
||||
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.set_default.html" title="tracing::subscriber::set_default fn">set_default</a></td><td class="docblock-short"><p>Sets the subscriber as the default for the duration of the lifetime of the
|
||||
returned <a href="../dispatcher/struct.DefaultGuard.html"><code>DefaultGuard</code></a></p>
|
||||
</td></tr><tr class="module-item"><td><a class="fn" href="fn.set_global_default.html" title="tracing::subscriber::set_global_default fn">set_global_default</a></td><td class="docblock-short"><p>Sets this subscriber as the global default for the duration of the entire program.
|
||||
Will be used as a fallback if no thread-local subscriber has been set in a thread (using <code>with_default</code>.)</p>
|
||||
</td></tr><tr class="module-item"><td><a class="fn" href="fn.with_default.html" title="tracing::subscriber::with_default fn">with_default</a></td><td class="docblock-short"><p>Sets this subscriber as the default for the duration of a closure.</p>
|
||||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1 @@
|
||||
initSidebarItems({"fn":[["set_default","Sets the subscriber as the default for the duration of the lifetime of the returned `DefaultGuard`"],["set_global_default","Sets this subscriber as the global default for the duration of the entire program. Will be used as a fallback if no thread-local subscriber has been set in a thread (using `with_default`.)"],["with_default","Sets this subscriber as the default for the duration of a closure."]],"struct":[["DefaultGuard","A guard that resets the current default dispatcher to the prior default dispatcher when dropped."],["Interest","Indicates a `Subscriber`’s interest in a particular callsite."],["SetGlobalDefaultError","Returned if setting the global dispatcher fails."]],"trait":[["Subscriber","Trait representing the functions required to collect trace data."]]});
|
||||
@@ -0,0 +1,22 @@
|
||||
<!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="A guard that resets the current default dispatcher to the prior default dispatcher when dropped."><meta name="keywords" content="rust, rustlang, rust-lang, DefaultGuard"><title>tracing::subscriber::DefaultGuard - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><p class="location">Struct DefaultGuard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Drop">Drop</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="DefaultGuard" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="struct" href="">DefaultGuard</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#207" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct DefaultGuard(_);</pre></div><div class="docblock"><p>A guard that resets the current default dispatcher to the prior
|
||||
default dispatcher when dropped.</p>
|
||||
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#206" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-Drop" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-Drop" class="anchor"></a><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#769-782" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.drop" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop" class="fnname">drop</a>(&mut self)</code><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#771" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
|
||||
</div></div></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"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.DefaultGuard.html" title="struct tracing::subscriber::DefaultGuard">DefaultGuard</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> 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></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../tracing/trait.Instrument.html" title="trait tracing::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="../../src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="../../tracing/struct.Span.html" title="struct tracing::Span">Span</a>) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.instrument">Read more</a></p>
|
||||
</div><h4 id="method.in_current_span" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.in_current_span">Read more</a></p>
|
||||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,48 @@
|
||||
<!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="Indicates a `Subscriber`’s interest in a particular callsite."><meta name="keywords" content="rust, rustlang, rust-lang, Interest"><title>tracing::subscriber::Interest - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><p class="location">Struct Interest</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.always">always</a><a href="#method.is_always">is_always</a><a href="#method.is_never">is_never</a><a href="#method.is_sometimes">is_sometimes</a><a href="#method.never">never</a><a href="#method.sometimes">sometimes</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="Interest" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="struct" href="">Interest</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#485" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Interest(_);</pre></div><div class="docblock"><p>Indicates a <a href="../trait.Subscriber.html"><code>Subscriber</code></a>’s interest in a particular callsite.</p>
|
||||
<p><code>Subscriber</code>s return an <code>Interest</code> from their <a href="../trait.Subscriber.html#method.register_callsite"><code>register_callsite</code></a> methods
|
||||
in order to determine whether that span should be enabled or disabled.</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#494-570" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.never" class="method"><code>pub fn <a href="#method.never" class="fnname">never</a>() -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#501" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an <code>Interest</code> indicating that the subscriber is never interested
|
||||
in being notified about a callsite.</p>
|
||||
<p>If all active subscribers are <code>never()</code> interested in a callsite, it will
|
||||
be completely disabled unless a new subscriber becomes active.</p>
|
||||
</div><h4 id="method.sometimes" class="method"><code>pub fn <a href="#method.sometimes" class="fnname">sometimes</a>() -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#513" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an <code>Interest</code> indicating the subscriber is sometimes interested
|
||||
in being notified about a callsite.</p>
|
||||
<p>If all active subscribers are <code>sometimes</code> or <code>never</code> interested in a
|
||||
callsite, the currently active subscriber will be asked to filter that
|
||||
callsite every time it creates a span. This will be the case until a new
|
||||
subscriber expresses that it is <code>always</code> interested in the callsite.</p>
|
||||
</div><h4 id="method.always" class="method"><code>pub fn <a href="#method.always" class="fnname">always</a>() -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#523" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an <code>Interest</code> indicating the subscriber is always interested in
|
||||
being notified about a callsite.</p>
|
||||
<p>If any subscriber expresses that it is <code>always()</code> interested in a given
|
||||
callsite, then the callsite will always be enabled.</p>
|
||||
</div><h4 id="method.is_never" class="method"><code>pub fn <a href="#method.is_never" class="fnname">is_never</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#530" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if the subscriber is never interested in being notified
|
||||
about this callsite.</p>
|
||||
</div><h4 id="method.is_sometimes" class="method"><code>pub fn <a href="#method.is_sometimes" class="fnname">is_sometimes</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#540" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if the subscriber is sometimes interested in being notified
|
||||
about this callsite.</p>
|
||||
</div><h4 id="method.is_always" class="method"><code>pub fn <a href="#method.is_always" class="fnname">is_always</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#550" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if the subscriber is always interested in being notified
|
||||
about this callsite.</p>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#484" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#484" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#484" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#484" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div></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"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> 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></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../tracing/trait.Instrument.html" title="trait tracing::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="../../src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="../../tracing/struct.Span.html" title="struct tracing::Span">Span</a>) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.instrument">Read more</a></p>
|
||||
</div><h4 id="method.in_current_span" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.in_current_span">Read more</a></p>
|
||||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-93" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&self) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#86" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#90" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code> <a href="https://github.com/tokio-rs/tracing/issues/41263">#41263</a>)</summary><p>recently added</p>
|
||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!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="Returned if setting the global dispatcher fails."><meta name="keywords" content="rust, rustlang, rust-lang, SetGlobalDefaultError"><title>tracing::subscriber::SetGlobalDefaultError - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><p class="location">Struct SetGlobalDefaultError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="SetGlobalDefaultError" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="struct" href="">SetGlobalDefaultError</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#308-310" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct SetGlobalDefaultError { /* fields omitted */ }</pre></div><div class="docblock"><p>Returned if setting the global dispatcher fails.</p>
|
||||
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#307" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#307" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#312-316" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#313" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-Error" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Error" class="anchor"></a><a class="srclink" href="../../src/tracing_core/dispatcher.rs.html#320" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source" class="fnname">source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
|
||||
</div><h4 id="method.backtrace" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace" class="fnname">backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#126" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>backtrace</code> <a href="https://github.com/tokio-rs/tracing/issues/53487">#53487</a>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
|
||||
</div><h4 id="method.description" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description" class="fnname">description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#138" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
|
||||
</div></div><div class='docblock hidden'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause" class="fnname">cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#148" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
|
||||
</div></div></div></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"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../tracing/subscriber/struct.SetGlobalDefaultError.html" title="struct tracing::subscriber::SetGlobalDefaultError">SetGlobalDefaultError</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> 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></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-Instrument" class="impl"><code class="in-band">impl<T> <a class="trait" href="../../tracing/trait.Instrument.html" title="trait tracing::Instrument">Instrument</a> for T</code><a href="#impl-Instrument" class="anchor"></a><a class="srclink" href="../../src/tracing/instrument.rs.html#155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.instrument" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="../../tracing/struct.Span.html" title="struct tracing::Span">Span</a>) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#38-40" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.instrument">Read more</a></p>
|
||||
</div><h4 id="method.in_current_span" class="method hidden"><code>fn <a href="../../tracing/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></h3><code class="content"><span class="where fmt-newline">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><T></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = T::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="../../src/tracing/instrument.rs.html#74-76" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Instruments this type with the <a href="../struct.Span.html#method.current">current</a> <code>Span</code>, returning an
|
||||
<code>Instrumented</code> wrapper. <a href="../../tracing/trait.Instrument.html#method.in_current_span">Read more</a></p>
|
||||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2205-2218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2211" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
||||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
@@ -0,0 +1,312 @@
|
||||
<!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="Trait representing the functions required to collect trace data."><meta name="keywords" content="rust, rustlang, rust-lang, Subscriber"><title>tracing::subscriber::Subscriber - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../tracing/index.html'><div class='logo-container'><img src='https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png' alt='logo'></div></a><p class="location">Trait Subscriber</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.event">event</a><a href="#tymethod.enabled">enabled</a><a href="#tymethod.enter">enter</a><a href="#tymethod.new_span">new_span</a><a href="#tymethod.exit">exit</a><a href="#tymethod.record">record</a><a href="#tymethod.record_follows_from">record_follows_from</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.current_span">current_span</a><a href="#method.clone_span">clone_span</a><a href="#method.try_close">try_close</a><a href="#method.register_callsite">register_callsite</a><a href="#method.max_level_hint">max_level_hint</a><a href="#method.drop_span">drop_span</a><a href="#method.downcast_raw">downcast_raw</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.downcast_ref">downcast_ref</a><a href="#method.is">is</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a></p><div id="sidebar-vars" data-name="Subscriber" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="../index.html">tracing</a>::<wbr><a href="index.html">subscriber</a>::<wbr><a class="trait" href="">Subscriber</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#70-455" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait Subscriber: 'static {
|
||||
pub fn <a href="#tymethod.enabled" class="fnname">enabled</a>(&self, metadata: &<a class="struct" href="../../tracing/struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.new_span" class="fnname">new_span</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Attributes.html" title="struct tracing::span::Attributes">Attributes</a><'_>) -> <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>;
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.record" class="fnname">record</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>, values: &<a class="struct" href="../../tracing/span/struct.Record.html" title="struct tracing::span::Record">Record</a><'_>);
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.record_follows_from" class="fnname">record_follows_from</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>, follows: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>);
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.event" class="fnname">event</a>(&self, event: &<a class="struct" href="../../tracing/event/struct.Event.html" title="struct tracing::event::Event">Event</a><'_>);
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.enter" class="fnname">enter</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>);
|
||||
<div class="item-spacer"></div> pub fn <a href="#tymethod.exit" class="fnname">exit</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>);
|
||||
|
||||
pub fn <a href="#method.register_callsite" class="fnname">register_callsite</a>(<br> &self, <br> metadata: &'static <a class="struct" href="../../tracing/struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'static><br> ) -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a> { ... }
|
||||
<div class="item-spacer"></div> pub fn <a href="#method.max_level_hint" class="fnname">max_level_hint</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../tracing/level_filters/struct.LevelFilter.html" title="struct tracing::level_filters::LevelFilter">LevelFilter</a>> { ... }
|
||||
<div class="item-spacer"></div> pub fn <a href="#method.clone_span" class="fnname">clone_span</a>(&self, id: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>) -> <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a> { ... }
|
||||
<div class="item-spacer"></div> pub fn <a href="#method.drop_span" class="fnname">drop_span</a>(&self, _id: <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>) { ... }
|
||||
<div class="item-spacer"></div> pub fn <a href="#method.try_close" class="fnname">try_close</a>(&self, id: <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||
<div class="item-spacer"></div> pub fn <a href="#method.current_span" class="fnname">current_span</a>(&self) -> <a class="struct" href="../../tracing_core/span/struct.Current.html" title="struct tracing_core::span::Current">Current</a> { ... }
|
||||
<div class="item-spacer"></div> pub unsafe fn <a href="#method.downcast_raw" class="fnname">downcast_raw</a>(&self, id: <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||||
}</pre></div><div class="docblock"><p>Trait representing the functions required to collect trace data.</p>
|
||||
<p>Crates that provide implementations of methods for collecting or recording
|
||||
trace data should implement the <code>Subscriber</code> interface. This trait is
|
||||
intended to represent fundamental primitives for collecting trace events and
|
||||
spans — other libraries may offer utility functions and types to make
|
||||
subscriber implementations more modular or improve the ergonomics of writing
|
||||
subscribers.</p>
|
||||
<p>A subscriber is responsible for the following:</p>
|
||||
<ul>
|
||||
<li>Registering new spans as they are created, and providing them with span
|
||||
IDs. Implicitly, this means the subscriber may determine the strategy for
|
||||
determining span equality.</li>
|
||||
<li>Recording the attachment of field values and follows-from annotations to
|
||||
spans.</li>
|
||||
<li>Filtering spans and events, and determining when those filters must be
|
||||
invalidated.</li>
|
||||
<li>Observing spans as they are entered, exited, and closed, and events as
|
||||
they occur.</li>
|
||||
</ul>
|
||||
<p>When a span is entered or exited, the subscriber is provided only with the
|
||||
<a href="../span/struct.Id.html">ID</a> with which it tagged that span when it was created. This means
|
||||
that it is up to the subscriber to determine whether and how span <em>data</em> —
|
||||
the fields and metadata describing the span — should be stored. The
|
||||
<a href="trait.Subscriber.html#method.new_span"><code>new_span</code></a> function is called when a new span is created, and at that
|
||||
point, the subscriber <em>may</em> choose to store the associated data if it will
|
||||
be referenced again. However, if the data has already been recorded and will
|
||||
not be needed by the implementations of <code>enter</code> and <code>exit</code>, the subscriber
|
||||
may freely discard that data without allocating space to store it.</p>
|
||||
<h2 id="overriding-default-impls" class="section-header"><a href="#overriding-default-impls">Overriding default impls</a></h2>
|
||||
<p>Some trait methods on <code>Subscriber</code> have default implementations, either in
|
||||
order to reduce the surface area of implementing <code>Subscriber</code>, or for
|
||||
backward-compatibility reasons. However, many subscribers will likely want
|
||||
to override these default implementations.</p>
|
||||
<p>The following methods are likely of interest:</p>
|
||||
<ul>
|
||||
<li><a href="trait.Subscriber.html#method.register_callsite"><code>register_callsite</code></a> is called once for each callsite from which a span
|
||||
event may originate, and returns an <a href="struct.Interest.html"><code>Interest</code></a> value describing whether or
|
||||
not the subscriber wishes to see events or spans from that callsite. By
|
||||
default, it calls <a href="trait.Subscriber.html#method.enabled"><code>enabled</code></a>, and returns <code>Interest::always()</code> if
|
||||
<code>enabled</code> returns true, or <code>Interest::never()</code> if enabled returns false.
|
||||
However, if the subscriber’s interest can change dynamically at runtime,
|
||||
it may want to override this function to return <code>Interest::sometimes()</code>.
|
||||
Additionally, subscribers which wish to perform a behaviour once for each
|
||||
callsite, such as allocating storage for data related to that callsite,
|
||||
can perform it in <code>register_callsite</code>.</li>
|
||||
<li><a href="trait.Subscriber.html#method.clone_span"><code>clone_span</code></a> is called every time a span ID is cloned, and <a href="trait.Subscriber.html#method.try_close"><code>try_close</code></a>
|
||||
is called when a span ID is dropped. By default, these functions do
|
||||
nothing. However, they can be used to implement reference counting for
|
||||
spans, allowing subscribers to free storage for span data and to determine
|
||||
when a span has <em>closed</em> permanently (rather than being exited).
|
||||
Subscribers which store per-span data or which need to track span closures
|
||||
should override these functions together.</li>
|
||||
</ul>
|
||||
</div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><h3 id="tymethod.enabled" class="method"><code>pub fn <a href="#tymethod.enabled" class="fnname">enabled</a>(&self, metadata: &<a class="struct" href="../../tracing/struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#168" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns true if a span or event with the specified <a href="../metadata/struct.Metadata.html">metadata</a> would be
|
||||
recorded.</p>
|
||||
<p>By default, it is assumed that this filter needs only be evaluated once
|
||||
for each callsite, so it is called by <a href="#method.register_callsite"><code>register_callsite</code></a> when each
|
||||
callsite is registered. The result is used to determine if the subscriber
|
||||
is always <a href="struct.Interest.html">interested</a> or never interested in that callsite. This is intended
|
||||
primarily as an optimization, so that expensive filters (such as those
|
||||
involving string search, et cetera) need not be re-evaluated.</p>
|
||||
<p>However, if the subscriber’s interest in a particular span or event may
|
||||
change, or depends on contexts only determined dynamically at runtime,
|
||||
then the <code>register_callsite</code> method should be overridden to return
|
||||
<a href="struct.Interest.html#method.sometimes"><code>Interest::sometimes</code></a>. In that case, this function will be called every
|
||||
time that span or event occurs.</p>
|
||||
</div><h3 id="tymethod.new_span" class="method"><code>pub fn <a href="#tymethod.new_span" class="fnname">new_span</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Attributes.html" title="struct tracing::span::Attributes">Attributes</a><'_>) -> <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#221" title="goto source code">[src]</a></h3><div class="docblock"><p>Visit the construction of a new span, returning a new <a href="../span/struct.Id.html">span ID</a> for the
|
||||
span being constructed.</p>
|
||||
<p>The provided <a href="../span/struct.Attributes.html"><code>Attributes</code></a> contains any field values that were provided
|
||||
when the span was created. The subscriber may pass a <a href="../field/trait.Visit.html">visitor</a> to the
|
||||
<code>Attributes</code>’ <a href="../span/struct.Attributes.html#method.record"><code>record</code> method</a> to record these values.</p>
|
||||
<p>IDs are used to uniquely identify spans and events within the context of a
|
||||
subscriber, so span equality will be based on the returned ID. Thus, if
|
||||
the subscriber wishes for all spans with the same metadata to be
|
||||
considered equal, it should return the same ID every time it is given a
|
||||
particular set of metadata. Similarly, if it wishes for two separate
|
||||
instances of a span with the same metadata to <em>not</em> be equal, it should
|
||||
return a distinct ID every time this function is called, regardless of
|
||||
the metadata.</p>
|
||||
<p>Note that the subscriber is free to assign span IDs based on whatever
|
||||
scheme it sees fit. Any guarantees about uniqueness, ordering, or ID
|
||||
reuse are left up to the subscriber implementation to determine.</p>
|
||||
</div><h3 id="tymethod.record" class="method"><code>pub fn <a href="#tymethod.record" class="fnname">record</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>, values: &<a class="struct" href="../../tracing/span/struct.Record.html" title="struct tracing::span::Record">Record</a><'_>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#262" title="goto source code">[src]</a></h3><div class="docblock"><p>Record a set of values on a span.</p>
|
||||
<p>This method will be invoked when value is recorded on a span.
|
||||
Recording multiple values for the same field is possible,
|
||||
but the actual behaviour is defined by the subscriber implementation.</p>
|
||||
<p>Keep in mind that a span might not provide a value
|
||||
for each field it declares.</p>
|
||||
<p>The subscriber is expected to provide a <a href="../field/trait.Visit.html">visitor</a> to the <code>Record</code>’s
|
||||
<a href="../span/struct.Record.html#method.record"><code>record</code> method</a> in order to record the added values.</p>
|
||||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
|
||||
<p>“foo = 3” will be recorded when <a href="../span/struct.Attributes.html#method.record"><code>record</code></a> is called on the
|
||||
<code>Attributes</code> passed to <code>new_span</code>.
|
||||
Since values are not provided for the <code>bar</code> and <code>baz</code> fields,
|
||||
the span’s <code>Metadata</code> will indicate that it <em>has</em> those fields,
|
||||
but values for them won’t be recorded at this time.</p>
|
||||
|
||||
<div class='information'><div class='tooltip ignore'>ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore">
|
||||
<span class="attribute">#[<span class="ident">macro_use</span>]</span>
|
||||
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">tracing</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">span</span> <span class="op">=</span> <span class="macro">span</span><span class="macro">!</span>(<span class="string">"my_span"</span>, <span class="ident">foo</span> <span class="op">=</span> <span class="number">3</span>, <span class="ident">bar</span>, <span class="ident">baz</span>);
|
||||
|
||||
<span class="comment">// `Subscriber::record` will be called with a `Record`</span>
|
||||
<span class="comment">// containing "bar = false"</span>
|
||||
<span class="ident">span</span>.<span class="ident">record</span>(<span class="string">"bar"</span>, <span class="kw-2">&</span><span class="bool-val">false</span>);
|
||||
|
||||
<span class="comment">// `Subscriber::record` will be called with a `Record`</span>
|
||||
<span class="comment">// containing "baz = "a string""</span>
|
||||
<span class="ident">span</span>.<span class="ident">record</span>(<span class="string">"baz"</span>, <span class="kw-2">&</span><span class="string">"a string"</span>);</pre></div>
|
||||
</div><h3 id="tymethod.record_follows_from" class="method"><code>pub fn <a href="#tymethod.record_follows_from" class="fnname">record_follows_from</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>, follows: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#282" title="goto source code">[src]</a></h3><div class="docblock"><p>Adds an indication that <code>span</code> follows from the span with the id
|
||||
<code>follows</code>.</p>
|
||||
<p>This relationship differs somewhat from the parent-child relationship: a
|
||||
span may have any number of prior spans, rather than a single one; and
|
||||
spans are not considered to be executing <em>inside</em> of the spans they
|
||||
follow from. This means that a span may close even if subsequent spans
|
||||
that follow from it are still open, and time spent inside of a
|
||||
subsequent span should not be included in the time its precedents were
|
||||
executing. This is used to model causal relationships such as when a
|
||||
single future spawns several related background tasks, et cetera.</p>
|
||||
<p>If the subscriber has spans corresponding to the given IDs, it should
|
||||
record this relationship in whatever way it deems necessary. Otherwise,
|
||||
if one or both of the given span IDs do not correspond to spans that the
|
||||
subscriber knows about, or if a cyclical relationship would be created
|
||||
(i.e., some span <em>a</em> which proceeds some other span <em>b</em> may not also
|
||||
follow from <em>b</em>), it may silently do nothing.</p>
|
||||
</div><h3 id="tymethod.event" class="method"><code>pub fn <a href="#tymethod.event" class="fnname">event</a>(&self, event: &<a class="struct" href="../../tracing/event/struct.Event.html" title="struct tracing::event::Event">Event</a><'_>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#302" title="goto source code">[src]</a></h3><div class="docblock"><p>Records that an <a href="../event/struct.Event.html"><code>Event</code></a> has occurred.</p>
|
||||
<p>This method will be invoked when an Event is constructed by
|
||||
the <code>Event</code>’s <a href="../event/struct.Event.html#method.dispatch"><code>dispatch</code> method</a>. For example, this happens internally
|
||||
when an event macro from <code>tracing</code> is called.</p>
|
||||
<p>The key difference between this method and <code>record</code> is that <code>record</code> is
|
||||
called when a value is recorded for a field defined by a span,
|
||||
while <code>event</code> is called when a new event occurs.</p>
|
||||
<p>The provided <code>Event</code> struct contains any field values attached to the
|
||||
event. The subscriber may pass a <a href="../field/trait.Visit.html">visitor</a> to the <code>Event</code>’s
|
||||
<a href="../event/struct.Event.html#method.record"><code>record</code> method</a> to record these values.</p>
|
||||
</div><h3 id="tymethod.enter" class="method"><code>pub fn <a href="#tymethod.enter" class="fnname">enter</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#312" title="goto source code">[src]</a></h3><div class="docblock"><p>Records that a span has been entered.</p>
|
||||
<p>When entering a span, this method is called to notify the subscriber
|
||||
that the span has been entered. The subscriber is provided with the
|
||||
<a href="../span/struct.Id.html">span ID</a> of the entered span, and should update any internal state
|
||||
tracking the current span accordingly.</p>
|
||||
</div><h3 id="tymethod.exit" class="method"><code>pub fn <a href="#tymethod.exit" class="fnname">exit</a>(&self, span: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#324" title="goto source code">[src]</a></h3><div class="docblock"><p>Records that a span has been exited.</p>
|
||||
<p>When exiting a span, this method is called to notify the subscriber
|
||||
that the span has been exited. The subscriber is provided with the
|
||||
<a href="../span/struct.Id.html">span ID</a> of the exited span, and should update any internal state
|
||||
tracking the current span accordingly.</p>
|
||||
<p>Exiting a span does not imply that the span will not be re-entered.</p>
|
||||
</div></div><span class="loading-content">Loading content...</span><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.register_callsite" class="method"><code>pub fn <a href="#method.register_callsite" class="fnname">register_callsite</a>(<br> &self, <br> metadata: &'static <a class="struct" href="../../tracing/struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'static><br>) -> <a class="struct" href="../../tracing/subscriber/struct.Interest.html" title="struct tracing::subscriber::Interest">Interest</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#140" title="goto source code">[src]</a></h3><div class="docblock"><p>Registers a new callsite with this subscriber, returning whether or not
|
||||
the subscriber is interested in being notified about the callsite.</p>
|
||||
<p>By default, this function assumes that the subscriber’s <a href="#method.enabled">filter</a>
|
||||
represents an unchanging view of its interest in the callsite. However,
|
||||
if this is not the case, subscribers may override this function to
|
||||
indicate different interests, or to implement behaviour that should run
|
||||
once for every callsite.</p>
|
||||
<p>This function is guaranteed to be called at least once per callsite on
|
||||
every active subscriber. The subscriber may store the keys to fields it
|
||||
cares about in order to reduce the cost of accessing fields by name,
|
||||
preallocate storage for that callsite, or perform any other actions it
|
||||
wishes to perform once for each callsite.</p>
|
||||
<p>The subscriber should then return an <a href="struct.Interest.html"><code>Interest</code></a>, indicating
|
||||
whether it is interested in being notified about that callsite in the
|
||||
future. This may be <code>Always</code> indicating that the subscriber always
|
||||
wishes to be notified about the callsite, and its filter need not be
|
||||
re-evaluated; <code>Sometimes</code>, indicating that the subscriber may sometimes
|
||||
care about the callsite but not always (such as when sampling), or
|
||||
<code>Never</code>, indicating that the subscriber never wishes to be notified about
|
||||
that callsite. If all active subscribers return <code>Never</code>, a callsite will
|
||||
never be enabled unless a new subscriber expresses interest in it.</p>
|
||||
<p><code>Subscriber</code>s which require their filters to be run every time an event
|
||||
occurs or a span is entered/exited should return <code>Interest::sometimes</code>.
|
||||
If a subscriber returns <code>Interest::sometimes</code>, then its’ <a href="#method.enabled"><code>enabled</code></a> method
|
||||
will be called every time an event or span is created from that callsite.</p>
|
||||
<p>For example, suppose a sampling subscriber is implemented by
|
||||
incrementing a counter every time <code>enabled</code> is called and only returning
|
||||
<code>true</code> when the counter is divisible by a specified sampling rate. If
|
||||
that subscriber returns <code>Interest::always</code> from <code>register_callsite</code>, then
|
||||
the filter will not be re-evaluated once it has been applied to a given
|
||||
set of metadata. Thus, the counter will not be incremented, and the span
|
||||
or event that corresponds to the metadata will never be <code>enabled</code>.</p>
|
||||
<p><code>Subscriber</code>s that need to change their filters occasionally should call
|
||||
<a href="../callsite/fn.rebuild_interest_cache.html"><code>rebuild_interest_cache</code></a> to re-evaluate <code>register_callsite</code> for all
|
||||
callsites.</p>
|
||||
<p>Similarly, if a <code>Subscriber</code> has a filtering strategy that can be
|
||||
changed dynamically at runtime, it would need to re-evaluate that filter
|
||||
if the cached results have changed.</p>
|
||||
<p>A subscriber which manages fanout to multiple other subscribers
|
||||
should proxy this decision to all of its child subscribers,
|
||||
returning <code>Interest::never</code> only if <em>all</em> such children return
|
||||
<code>Interest::never</code>. If the set of subscribers to which spans are
|
||||
broadcast may change dynamically, the subscriber should also never
|
||||
return <code>Interest::Never</code>, as a new subscriber may be added that <em>is</em>
|
||||
interested.</p>
|
||||
<h1 id="notes" class="section-header"><a href="#notes">Notes</a></h1>
|
||||
<p>This function may be called again when a new subscriber is created or
|
||||
when the registry is invalidated.</p>
|
||||
<p>If a subscriber returns <code>Interest::never</code> for a particular callsite, it
|
||||
<em>may</em> still see spans and events originating from that callsite, if
|
||||
another subscriber expressed interest in it.</p>
|
||||
</div><h3 id="method.max_level_hint" class="method"><code>pub fn <a href="#method.max_level_hint" class="fnname">max_level_hint</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../tracing/level_filters/struct.LevelFilter.html" title="struct tracing::level_filters::LevelFilter">LevelFilter</a>></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#193" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the highest <a href="../struct.Level.html">verbosity level</a> that this <code>Subscriber</code> will
|
||||
enable, or <code>None</code>, if the subscriber does not implement level-based
|
||||
filtering or chooses not to implement this method.</p>
|
||||
<p>If this method returns a <a href="../struct.Level.html"><code>Level</code></a>, it will be used as a hint to
|
||||
determine the most verbose level that will be enabled. This will allow
|
||||
spans and events which are more verbose than that level to be skipped
|
||||
more efficiently. Subscribers which perform filtering are strongly
|
||||
encouraged to provide an implementation of this method.</p>
|
||||
<p>If the maximum level the subscriber will enable can change over the
|
||||
course of its lifetime, it is free to return a different value from
|
||||
multiple invocations of this method. However, note that changes in the
|
||||
maximum level will <strong>only</strong> be reflected after the callsite <a href="struct.Interest.html"><code>Interest</code></a>
|
||||
cache is rebuilt, by calling the <a href="../callsite/fn.rebuild_interest_cache.html"><code>callsite::rebuild_interest_cache</code></a>
|
||||
function. Therefore, if the subscriber will change the value returned by
|
||||
this method, it is responsible for ensuring that
|
||||
<a href="../callsite/fn.rebuild_interest_cache.html"><code>rebuild_interest_cache</code></a> is called after the value of the max
|
||||
level changes.</p>
|
||||
</div><h3 id="method.clone_span" class="method"><code>pub fn <a href="#method.clone_span" class="fnname">clone_span</a>(&self, id: &<a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>) -> <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#346" title="goto source code">[src]</a></h3><div class="docblock"><p>Notifies the subscriber that a <a href="../span/struct.Id.html">span ID</a> has been cloned.</p>
|
||||
<p>This function is guaranteed to only be called with span IDs that were
|
||||
returned by this subscriber’s <code>new_span</code> function.</p>
|
||||
<p>Note that the default implementation of this function this is just the
|
||||
identity function, passing through the identifier. However, it can be
|
||||
used in conjunction with <a href="trait.Subscriber.html#method.try_close"><code>try_close</code></a> to track the number of handles
|
||||
capable of <code>enter</code>ing a span. When all the handles have been dropped
|
||||
(i.e., <code>try_close</code> has been called one more time than <code>clone_span</code> for a
|
||||
given ID), the subscriber may assume that the span will not be entered
|
||||
again. It is then free to deallocate storage for data associated with
|
||||
that span, write data from that span to IO, and so on.</p>
|
||||
<p>For more unsafe situations, however, if <code>id</code> is itself a pointer of some
|
||||
kind this can be used as a hook to “clone” the pointer, depending on
|
||||
what that means for the specified pointer.</p>
|
||||
</div><h3 id="method.drop_span" class="method"><code>pub fn <a href="#method.drop_span" class="fnname">drop_span</a>(&self, _id: <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>)</code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#360" title="goto source code">[src]</a></h3><div class="item-info"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 0.1.2: <p>use <code>Subscriber::try_close</code> instead</p>
|
||||
</div></div><div class="docblock"><p><strong>This method is deprecated.</strong></p>
|
||||
<p>Using <code>drop_span</code> may result in subscribers composed using
|
||||
<code>tracing-subscriber</code> crate’s <code>Layer</code> trait from observing close events.
|
||||
Use <a href="trait.Subscriber.html#method.try_close"><code>try_close</code></a> instead.</p>
|
||||
<p>The default implementation of this function does nothing.</p>
|
||||
</div><h3 id="method.try_close" class="method"><code>pub fn <a href="#method.try_close" class="fnname">try_close</a>(&self, id: <a class="struct" href="../../tracing/span/struct.Id.html" title="struct tracing::span::Id">Id</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#398" title="goto source code">[src]</a></h3><div class="docblock"><p>Notifies the subscriber that a [<code>span ID</code>] has been dropped, and returns
|
||||
<code>true</code> if there are now 0 IDs that refer to that span.</p>
|
||||
<p>Higher-level libraries providing functionality for composing multiple
|
||||
subscriber implementations may use this return value to notify any
|
||||
“layered” subscribers that this subscriber considers the span closed.</p>
|
||||
<p>The default implementation of this method calls the subscriber’s
|
||||
<a href="trait.Subscriber.html#method.drop_span"><code>drop_span</code></a> method and returns <code>false</code>. This means that, unless the
|
||||
subscriber overrides the default implementation, close notifications
|
||||
will never be sent to any layered subscribers. In general, if the
|
||||
subscriber tracks reference counts, this method should be implemented,
|
||||
rather than <code>drop_span</code>.</p>
|
||||
<p>This function is guaranteed to only be called with span IDs that were
|
||||
returned by this subscriber’s <code>new_span</code> function.</p>
|
||||
<p>It’s guaranteed that if this function has been called once more than the
|
||||
number of times <code>clone_span</code> was called with the same <code>id</code>, then no more
|
||||
handles that can enter the span with that <code>id</code> exist. This means that it
|
||||
can be used in conjunction with <a href="trait.Subscriber.html#method.clone_span"><code>clone_span</code></a> to track the number of
|
||||
handles capable of <code>enter</code>ing a span. When all the handles have been
|
||||
dropped (i.e., <code>try_close</code> has been called one more time than
|
||||
<code>clone_span</code> for a given ID), the subscriber may assume that the span
|
||||
will not be entered again, and should return <code>true</code>. It is then free to
|
||||
deallocate storage for data associated with that span, write data from
|
||||
that span to IO, and so on.</p>
|
||||
<p><strong>Note</strong>: since this function is called when spans are dropped,
|
||||
implementations should ensure that they are unwind-safe. Panicking from
|
||||
inside of a <code>try_close</code> function may cause a double panic, if the span
|
||||
was dropped due to a thread unwinding.</p>
|
||||
</div><h3 id="method.current_span" class="method"><code>pub fn <a href="#method.current_span" class="fnname">current_span</a>(&self) -> <a class="struct" href="../../tracing_core/span/struct.Current.html" title="struct tracing_core::span::Current">Current</a></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#417" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns a type representing this subscriber’s view of the current span.</p>
|
||||
<p>If subscribers track a current span, they should override this function
|
||||
to return <a href="../span/struct.Current.html#tymethod.new"><code>Current::new</code></a> if the thread from which this method is
|
||||
called is inside a span, or <a href="../span/struct.Current.html#tymethod.none"><code>Current::none</code></a> if the thread is not
|
||||
inside a span.</p>
|
||||
<p>By default, this returns a value indicating that the subscriber
|
||||
does <strong>not</strong> track what span is current. If the subscriber does not
|
||||
implement a current span, it should not override this method.</p>
|
||||
</div><h3 id="method.downcast_raw" class="method"><code>pub unsafe fn <a href="#method.downcast_raw" class="fnname">downcast_raw</a>(&self, id: <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#448" title="goto source code">[src]</a></h3><div class="docblock"><p>If <code>self</code> is the same type as the provided <code>TypeId</code>, returns an untyped
|
||||
<code>*const</code> pointer to that type. Otherwise, returns <code>None</code>.</p>
|
||||
<p>If you wish to downcast a <code>Subscriber</code>, it is strongly advised to use
|
||||
the safe API provided by <a href="#method.downcast_ref"><code>downcast_ref</code></a> instead.</p>
|
||||
<p>This API is required for <code>downcast_raw</code> to be a trait method; a method
|
||||
signature like <a href="#method.downcast_ref"><code>downcast_ref</code></a> (with a generic type parameter) is not
|
||||
object-safe, and thus cannot be a trait method for <code>Subscriber</code>. This
|
||||
means that if we only exposed <code>downcast_ref</code>, <code>Subscriber</code>
|
||||
implementations could not override the downcasting behavior</p>
|
||||
<p>This method may be overridden by “fan out” or “chained” subscriber
|
||||
implementations which consist of multiple composed types. Such
|
||||
subscribers might allow <code>downcast_raw</code> by returning references to those
|
||||
component if they contain components with the given <code>TypeId</code>.</p>
|
||||
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
|
||||
<p>The <a href="#method.downcast_ref"><code>downcast_ref</code></a> method expects that the pointer returned by
|
||||
<code>downcast_raw</code> is non-null and points to a valid instance of the type
|
||||
with the provided <code>TypeId</code>. Failure to ensure this will result in
|
||||
undefined behaviour, so implementing <code>downcast_raw</code> is unsafe.</p>
|
||||
</div></div><span class="loading-content">Loading content...</span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl dyn <a class="trait" href="../../tracing/trait.Subscriber.html" title="trait tracing::Subscriber">Subscriber</a> + 'static</code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#457-475" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.is" class="method"><code>pub fn <a href="#method.is" class="fnname">is</a><T>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#459" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if this <code>Subscriber</code> is the same type as <code>T</code>.</p>
|
||||
</div><h4 id="method.downcast_ref" class="method"><code>pub fn <a href="#method.downcast_ref" class="fnname">downcast_ref</a><T>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a class="srclink" href="../../src/tracing_core/subscriber.rs.html#465" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns some reference to this <code>Subscriber</code> value if it is of type <code>T</code>,
|
||||
or <code>None</code> if it isn’t.</p>
|
||||
</div></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/tracing_core/subscriber/trait.Subscriber.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="tracing"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
Reference in New Issue
Block a user