edlang/tracing/trait.Value.html

17 lines
56 KiB
HTML
Raw Normal View History

<!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 field value of an erased type."><title>Value in tracing - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tracing" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../tracing/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../tracing/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../tracing/index.html">tracing</a><span class="version">0.1.40</span></h2></div><h2 class="location"><a href="#">Value</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.record">record</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Value-for-%26T">&amp;&#x27;a T</a></li><li><a href="#impl-Value-for-%26mut+T">&amp;&#x27;a mut T</a></li><li><a href="#impl-Value-for-Arguments%3C'a%3E">Arguments&lt;&#x27;a&gt;</a></li><li><a href="#impl-Value-for-Box%3CT%3E">Box&lt;T&gt;</a></li><li><a href="#impl-Value-for-NonZeroI128">NonZeroI128</a></li><li><a href="#impl-Value-for-NonZeroI16">NonZeroI16</a></li><li><a href="#impl-Value-for-NonZeroI32">NonZeroI32</a></li><li><a href="#impl-Value-for-NonZeroI64">NonZeroI64</a></li><li><a href="#impl-Value-for-NonZeroI8">NonZeroI8</a></li><li><a href="#impl-Value-for-NonZeroIsize">NonZeroIsize</a></li><li><a href="#impl-Value-for-NonZeroU128">NonZeroU128</a></li><li><a href="#impl-Value-for-NonZeroU16">NonZeroU16</a></li><li><a href="#impl-Value-for-NonZeroU32">NonZeroU32</a></li><li><a href="#impl-Value-for-NonZeroU64">NonZeroU64</a></li><li><a href="#impl-Value-for-NonZeroU8">NonZeroU8</a></li><li><a href="#impl-Value-for-NonZeroUsize">NonZeroUsize</a></li><li><a href="#impl-Value-for-Option%3CT%3E">Option&lt;T&gt;</a></li><li><a href="#impl-Value-for-String">String</a></li><li><a
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../tracing/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="index.html">tracing</a>::<wbr><a class="trait" href="#">Value</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/tracing_core/field.rs.html#336">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Value: Sealed {
// Required method
fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>);
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A field value of an erased type.</p>
<p>Implementors of <code>Value</code> may call the appropriate typed recording methods on
the <a href="field/trait.Visit.html" title="trait tracing::field::Visit">visitor</a> passed to their <code>record</code> method in order to indicate how
their data should be recorded.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.record" class="method"><a class="src rightside" href="../src/tracing_core/field.rs.html#338">source</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></summary><div class="docblock"><p>Visits this value with the given <code>Visitor</code>.</p>
</div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-dyn+Value" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#638">source</a><a href="#impl-Debug-for-dyn+Value" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for dyn <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#639">source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Display-for-dyn+Value" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#667">source</a><a href="#impl-Display-for-dyn+Value" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for dyn <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#668">source</a><a href="#method.fmt-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Value-for-bool" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#517-526">source</a><a href="#impl-Value-for-bool" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h3></section></su
T: <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> + 'a + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-34" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#593">source</a><a href="#method.record-34" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Value-for-%26mut+T" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#600-602">source</a><a href="#impl-Value-for-%26mut+T" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&amp;'a mut T</a><div class="where">where
T: <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> + 'a + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-35" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#604">source</a><a href="#method.record-35" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Value-for-Option%3CT%3E" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#749">source</a><a href="#impl-Value-for-Option%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-36" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#750">source</a><a href="#method.record-36" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Value-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#621-623">source</a><a href="#impl-Value-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-37" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#626">source</a><a href="#method.record-37" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Value-for-Wrapping%3CT%3E" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#529">source</a><a href="#impl-Value-for-Wrapping%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/core/num/wrapping/struct.Wrapping.html" title="struct core::num::wrapping::Wrapping">Wrapping</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-38" class="method trait-impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#530">source</a><a href="#method.record-38" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, key: &amp;<a class="struct" href="field/struct.Field.html" title="struct tracing::field::Field">Field</a>, visitor: &amp;mut dyn <a class="trait" href="field/trait.Visit.html" title="trait tracing::field::Visit">Visit</a>)</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Value-for-Empty" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#742">source</a><a href="#impl-Value-for-Empty" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="struct" href="field/struct.Empty.html" title="struct tracing::field::Empty">Empty</a></h3></section><section id="impl-Value-for-DebugValue%3CT%3E" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#702-704">source</a><a href="#impl-Value-for-DebugValue%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="struct" href="field/struct.DebugValue.html" title="struct tracing::field::DebugValue">DebugValue</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section><section id="impl-Value-for-DisplayValue%3CT%3E" class="impl"><a class="src rightside" href="../src/tracing_core/field.rs.html#677-679">source</a><a href="#impl-Value-for-DisplayValue%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="trait.Value.html" title="trait tracing::Value">Value</a> for <a class="struct" href="field/struct.DisplayValue.html" title="struct tracing::field::DisplayValue">DisplayValue</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>,</div></h3></section></div><script src="../trait.impl/tracing_core/field/trait.Value.js" data-ignore-extern-crates="alloc,core,tracing_core,std" async></script></section></div></main></body></html>