mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-18 16:49:53 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
4
tracing/field/fn.debug.html
Normal file
4
tracing/field/fn.debug.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<!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="Wraps a type implementing `fmt::Debug` as a `Value` that can be recorded using its `Debug` implementation."><title>debug in tracing::field - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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" title="show sidebar"></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.41</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing::<wbr>field</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tracing</a>::<wbr><a href="index.html">field</a></span><h1>Function <span class="fn">debug</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tracing_core/field.rs.html#368-370">Source</a> </span></div><pre class="rust item-decl"><code>pub fn debug<T>(t: T) -> <a class="struct" href="struct.DebugValue.html" title="struct tracing::field::DebugValue">DebugValue</a><T><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Wraps a type implementing <code>fmt::Debug</code> as a <code>Value</code> that can be
|
||||
recorded using its <code>Debug</code> implementation.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
4
tracing/field/fn.display.html
Normal file
4
tracing/field/fn.display.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<!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="Wraps a type implementing `fmt::Display` as a `Value` that can be recorded using its `Display` implementation."><title>display in tracing::field - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[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" title="show sidebar"></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.41</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing::<wbr>field</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tracing</a>::<wbr><a href="index.html">field</a></span><h1>Function <span class="fn">display</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tracing_core/field.rs.html#359-361">Source</a> </span></div><pre class="rust item-decl"><code>pub fn display<T>(t: T) -> <a class="struct" href="struct.DisplayValue.html" title="struct tracing::field::DisplayValue">DisplayValue</a><T><div class="where">where
|
||||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Wraps a type implementing <code>fmt::Display</code> as a <code>Value</code> that can be
|
||||
recorded using its <code>Display</code> implementation.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
85
tracing/field/index.html
Normal file
85
tracing/field/index.html
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<!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="`Span` and `Event` key-value data."><title>tracing::field - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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" title="show sidebar"></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.41</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module field</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#values-and-subscribers" title="`Value`s and `Subscriber`s"><code>Value</code>s and <code>Subscriber</code>s</a></li><li><a href="#using-valuable" title="Using `valuable`">Using <code>valuable</code></a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tracing</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tracing</a></span><h1>Module <span>field</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tracing/field.rs.html#1-170">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>Span</code> and <code>Event</code> key-value data.</p>
|
||||
<p>Spans and events may be annotated with key-value data, referred to as <em>fields</em>.
|
||||
These fields consist of a mapping from a key (corresponding to
|
||||
a <code>&str</code> but represented internally as an array index) to a <a href="../trait.Value.html" title="trait tracing::Value"><code>Value</code></a>.</p>
|
||||
<h2 id="values-and-subscribers"><a class="doc-anchor" href="#values-and-subscribers">§</a><code>Value</code>s and <code>Subscriber</code>s</h2>
|
||||
<p><code>Subscriber</code>s consume <code>Value</code>s as fields attached to <a href="../span/index.html" title="mod tracing::span">span</a>s or <a href="../event/struct.Event.html" title="struct tracing::event::Event"><code>Event</code></a>s.
|
||||
The set of field keys on a given span or event is defined on its <a href="../struct.Metadata.html" title="struct tracing::Metadata"><code>Metadata</code></a>.
|
||||
When a span is created, it provides <a href="../span/struct.Attributes.html" title="struct tracing::span::Attributes"><code>Attributes</code></a> to the <code>Subscriber</code>’s
|
||||
<a href="../trait.Subscriber.html#tymethod.new_span" title="method tracing::Subscriber::new_span"><code>new_span</code></a> method, containing any fields whose values were provided when
|
||||
the span was created; and may call the <code>Subscriber</code>’s <a href="../span/struct.Record.html" title="struct tracing::span::Record"><code>record</code></a> method
|
||||
with additional <a href="../span/struct.Record.html" title="struct tracing::span::Record"><code>Record</code></a>s if values are added for more of its fields.
|
||||
Similarly, the <a href="../event/struct.Event.html" title="struct tracing::event::Event"><code>Event</code></a> type passed to the subscriber’s <a href="../event/struct.Event.html" title="struct tracing::event::Event"><code>event</code></a> method
|
||||
will contain any fields attached to each event.</p>
|
||||
<p><code>tracing</code> represents values as either one of a set of Rust primitives
|
||||
(<code>i64</code>, <code>u64</code>, <code>f64</code>, <code>bool</code>, and <code>&str</code>) or using a <code>fmt::Display</code> or
|
||||
<code>fmt::Debug</code> implementation. <code>Subscriber</code>s are provided these primitive
|
||||
value types as <code>dyn Value</code> trait objects.</p>
|
||||
<p>These trait objects can be formatted using <code>fmt::Debug</code>, but may also be
|
||||
recorded as typed data by calling the <a href="../trait.Value.html#tymethod.record" title="method tracing::Value::record"><code>Value::record</code></a> method on these
|
||||
trait objects with a <em>visitor</em> implementing the <a href="trait.Visit.html" title="trait tracing::field::Visit"><code>Visit</code></a> trait. This trait
|
||||
represents the behavior used to record values of various types. For example,
|
||||
an implementation of <code>Visit</code> might record integers by incrementing counters
|
||||
for their field names rather than printing them.</p>
|
||||
<h2 id="using-valuable"><a class="doc-anchor" href="#using-valuable">§</a>Using <code>valuable</code></h2>
|
||||
<p><code>tracing</code>’s <a href="../trait.Value.html" title="trait tracing::Value"><code>Value</code></a> trait is intentionally minimalist: it supports only a small
|
||||
number of Rust primitives as typed values, and only permits recording
|
||||
user-defined types with their <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug"><code>fmt::Debug</code></a> or <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug"><code>fmt::Display</code></a>
|
||||
implementations. However, there are some cases where it may be useful to record
|
||||
nested values (such as arrays, <code>Vec</code>s, or <code>HashMap</code>s containing values), or
|
||||
user-defined <code>struct</code> and <code>enum</code> types without having to format them as
|
||||
unstructured text.</p>
|
||||
<p>To address <code>Value</code>’s limitations, <code>tracing</code> offers experimental support for
|
||||
the <a href="https://crates.io/crates/valuable"><code>valuable</code></a> crate, which provides object-safe inspection of structured
|
||||
values. User-defined types can implement the <a href="https://docs.rs/valuable/latest/valuable/trait.Valuable.html"><code>valuable::Valuable</code></a> trait,
|
||||
and be recorded as a <code>tracing</code> field by calling their <a href="https://docs.rs/valuable/latest/valuable/trait.Valuable.html#tymethod.as_value"><code>as_value</code></a> method.
|
||||
If the <a href="../trait.Subscriber.html" title="trait tracing::Subscriber"><code>Subscriber</code></a> also supports the <code>valuable</code> crate, it can
|
||||
then visit those types fields as structured values using <code>valuable</code>.</p>
|
||||
<pre class="ignore" style="white-space:normal;font:inherit;">
|
||||
<strong>Note</strong>: <code>valuable</code> support is an
|
||||
<a href = "../index.html#unstable-features">unstable feature</a>. See
|
||||
the documentation on unstable features for details on how to enable it.
|
||||
</pre>
|
||||
<p>For example:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// Derive `Valuable` for our types:
|
||||
</span><span class="kw">use </span>valuable::Valuable;
|
||||
|
||||
<span class="attr">#[derive(Clone, Debug, Valuable)]
|
||||
</span><span class="kw">struct </span>User {
|
||||
name: String,
|
||||
age: u32,
|
||||
address: Address,
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Clone, Debug, Valuable)]
|
||||
</span><span class="kw">struct </span>Address {
|
||||
country: String,
|
||||
city: String,
|
||||
street: String,
|
||||
}
|
||||
|
||||
<span class="kw">let </span>user = User {
|
||||
name: <span class="string">"Arwen Undomiel"</span>.to_string(),
|
||||
age: <span class="number">3000</span>,
|
||||
address: Address {
|
||||
country: <span class="string">"Middle Earth"</span>.to_string(),
|
||||
city: <span class="string">"Rivendell"</span>.to_string(),
|
||||
street: <span class="string">"leafy lane"</span>.to_string(),
|
||||
},
|
||||
};
|
||||
|
||||
<span class="comment">// Recording `user` as a `valuable::Value` will allow the `tracing` subscriber
|
||||
// to traverse its fields as a nested, typed structure:
|
||||
</span><span class="macro">tracing::info!</span>(current_user = user.as_value());</code></pre></div>
|
||||
<p>Alternatively, the [<code>valuable()</code>] function may be used to convert a type
|
||||
implementing <a href="https://crates.io/crates/valuable"><code>Valuable</code></a> into a <code>tracing</code> field value.</p>
|
||||
<p>When the <code>valuable</code> feature is enabled, the <a href="trait.Visit.html" title="trait tracing::field::Visit"><code>Visit</code></a> trait will include an
|
||||
optional <a href="Visit::record_value"><code>record_value</code></a> method. <code>Visit</code> implementations that wish to
|
||||
record <code>valuable</code> values can implement this method with custom behavior.
|
||||
If a visitor does not implement <code>record_value</code>, the <a href="https://docs.rs/valuable/latest/valuable/enum.Value.html"><code>valuable::Value</code></a> will
|
||||
be forwarded to the visitor’s <a href="trait.Visit.html#tymethod.record_debug" title="method tracing::field::Visit::record_debug"><code>record_debug</code></a> method.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.DebugValue.html" title="struct tracing::field::DebugValue">Debug<wbr>Value</a></div><div class="desc docblock-short">A <code>Value</code> which serializes as a string using <code>fmt::Debug</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.DisplayValue.html" title="struct tracing::field::DisplayValue">Display<wbr>Value</a></div><div class="desc docblock-short">A <code>Value</code> which serializes using <code>fmt::Display</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Empty.html" title="struct tracing::field::Empty">Empty</a></div><div class="desc docblock-short">An empty field.</div></li><li><div class="item-name"><a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a></div><div class="desc docblock-short">An opaque key allowing <em>O</em>(1) access to a field in a <code>Span</code>’s key-value
|
||||
data.</div></li><li><div class="item-name"><a class="struct" href="struct.FieldSet.html" title="struct tracing::field::FieldSet">Field<wbr>Set</a></div><div class="desc docblock-short">Describes the fields present on a span.</div></li><li><div class="item-name"><a class="struct" href="struct.Iter.html" title="struct tracing::field::Iter">Iter</a></div><div class="desc docblock-short">An iterator over a set of fields.</div></li><li><div class="item-name"><a class="struct" href="struct.ValueSet.html" title="struct tracing::field::ValueSet">Value<wbr>Set</a></div><div class="desc docblock-short">A set of fields and values for a span.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.AsField.html" title="trait tracing::field::AsField">AsField</a></div><div class="desc docblock-short">Trait implemented to allow a type to be used as a field key.</div></li><li><div class="item-name"><a class="trait" href="trait.Value.html" title="trait tracing::field::Value">Value</a></div><div class="desc docblock-short">A field value of an erased type.</div></li><li><div class="item-name"><a class="trait" href="trait.Visit.html" title="trait tracing::field::Visit">Visit</a></div><div class="desc docblock-short">Visits typed values.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.debug.html" title="fn tracing::field::debug">debug</a></div><div class="desc docblock-short">Wraps a type implementing <code>fmt::Debug</code> as a <code>Value</code> that can be
|
||||
recorded using its <code>Debug</code> implementation.</div></li><li><div class="item-name"><a class="fn" href="fn.display.html" title="fn tracing::field::display">display</a></div><div class="desc docblock-short">Wraps a type implementing <code>fmt::Display</code> as a <code>Value</code> that can be
|
||||
recorded using its <code>Display</code> implementation.</div></li></ul></section></div></main></body></html>
|
||||
1
tracing/field/sidebar-items.js
Normal file
1
tracing/field/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"fn":["debug","display"],"struct":["DebugValue","DisplayValue","Empty","Field","FieldSet","Iter","ValueSet"],"trait":["AsField","Value","Visit"]};
|
||||
30
tracing/field/struct.DebugValue.html
Normal file
30
tracing/field/struct.DebugValue.html
Normal file
File diff suppressed because one or more lines are too long
34
tracing/field/struct.DisplayValue.html
Normal file
34
tracing/field/struct.DisplayValue.html
Normal file
File diff suppressed because one or more lines are too long
21
tracing/field/struct.Empty.html
Normal file
21
tracing/field/struct.Empty.html
Normal file
File diff suppressed because one or more lines are too long
34
tracing/field/struct.Field.html
Normal file
34
tracing/field/struct.Field.html
Normal file
File diff suppressed because one or more lines are too long
42
tracing/field/struct.FieldSet.html
Normal file
42
tracing/field/struct.FieldSet.html
Normal file
File diff suppressed because one or more lines are too long
225
tracing/field/struct.Iter.html
Normal file
225
tracing/field/struct.Iter.html
Normal file
File diff suppressed because one or more lines are too long
24
tracing/field/struct.ValueSet.html
Normal file
24
tracing/field/struct.ValueSet.html
Normal file
File diff suppressed because one or more lines are too long
16
tracing/field/trait.AsField.html
Normal file
16
tracing/field/trait.AsField.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!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 implemented to allow a type to be used as a field key."><title>AsField in tracing::field - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.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" title="show sidebar"></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.41</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">AsField</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.as_field" title="as_field">as_field</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-AsField-for-str" title="str">str</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing::<wbr>field</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tracing</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">AsField</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tracing/field.rs.html#129-135">Source</a> </span></div><pre class="rust item-decl"><code>pub trait AsField: Sealed {
|
||||
// Required method
|
||||
fn <a href="#tymethod.as_field" class="fn">as_field</a>(&self, metadata: &<a class="struct" href="../struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait implemented to allow a type to be used as a field key.</p>
|
||||
<pre class="ignore" style="white-space:normal;font:inherit;">
|
||||
<strong>Note</strong>: Although this is implemented for both the
|
||||
<a href="./struct.Field.html"><code>Field</code></a> type <em>and</em> any
|
||||
type that can be borrowed as an <code>&str</code>, only <code>Field</code>
|
||||
allows <em>O</em>(1) access.
|
||||
Indexing a field with a string results in an iterative search that performs
|
||||
string comparisons. Thus, if possible, once the key for a field is known, it
|
||||
should be used whenever possible.
|
||||
</pre></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.as_field" class="method"><a class="src rightside" href="../../src/tracing/field.rs.html#134">Source</a><h4 class="code-header">fn <a href="#tymethod.as_field" class="fn">as_field</a>(&self, metadata: &<a class="struct" href="../struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>></h4></section></summary><div class="docblock"><p>Attempts to convert <code>&self</code> into a <code>Field</code> with the specified <code>metadata</code>.</p>
|
||||
<p>If <code>metadata</code> defines this field, then the field is returned. Otherwise,
|
||||
this returns <code>None</code>.</p>
|
||||
</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-AsField-for-str" class="impl"><a class="src rightside" href="../../src/tracing/field.rs.html#161-166">Source</a><a href="#impl-AsField-for-str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsField.html" title="trait tracing::field::AsField">AsField</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="method.as_field" class="method trait-impl"><a class="src rightside" href="../../src/tracing/field.rs.html#163-165">Source</a><a href="#method.as_field" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.as_field" class="fn">as_field</a>(&self, metadata: &<a class="struct" href="../struct.Metadata.html" title="struct tracing::Metadata">Metadata</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</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-AsField-for-Field" class="impl"><a class="src rightside" href="../../src/tracing/field.rs.html#139-148">Source</a><a href="#impl-AsField-for-Field" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.AsField.html" title="trait tracing::field::AsField">AsField</a> for <a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a></h3></section><section id="impl-AsField-for-%26Field" class="impl"><a class="src rightside" href="../../src/tracing/field.rs.html#150-159">Source</a><a href="#impl-AsField-for-%26Field" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="trait.AsField.html" title="trait tracing::field::AsField">AsField</a> for &'a <a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a></h3></section></div><script src="../../trait.impl/tracing/field/trait.AsField.js" data-ignore-extern-crates="tracing_core,std" async></script></section></div></main></body></html>
|
||||
16
tracing/field/trait.Value.html
Normal file
16
tracing/field/trait.Value.html
Normal file
File diff suppressed because one or more lines are too long
98
tracing/field/trait.Visit.html
Normal file
98
tracing/field/trait.Visit.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<!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="Visits typed values."><title>Visit in tracing::field - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.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.84.1 (e71f9a9a9 2025-01-27)" data-channel="1.84.1" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.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" title="show sidebar"></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.41</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Visit</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.record_debug" title="record_debug">record_debug</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.record_bool" title="record_bool">record_bool</a></li><li><a href="#method.record_bytes" title="record_bytes">record_bytes</a></li><li><a href="#method.record_error" title="record_error">record_error</a></li><li><a href="#method.record_f64" title="record_f64">record_f64</a></li><li><a href="#method.record_i128" title="record_i128">record_i128</a></li><li><a href="#method.record_i64" title="record_i64">record_i64</a></li><li><a href="#method.record_str" title="record_str">record_str</a></li><li><a href="#method.record_u128" title="record_u128">record_u128</a></li><li><a href="#method.record_u64" title="record_u64">record_u64</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Visit-for-DebugMap%3C'a,+'b%3E" title="DebugMap<'a, 'b>">DebugMap<'a, 'b></a></li><li><a href="#impl-Visit-for-DebugStruct%3C'a,+'b%3E" title="DebugStruct<'a, 'b>">DebugStruct<'a, 'b></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing::<wbr>field</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">tracing</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">Visit</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tracing_core/field.rs.html#266">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Visit {
|
||||
// Required method
|
||||
fn <a href="#tymethod.record_debug" class="fn">record_debug</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>);
|
||||
|
||||
// Provided methods
|
||||
fn <a href="#method.record_f64" class="fn">record_f64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.f64.html">f64</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_i64" class="fn">record_i64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_u64" class="fn">record_u64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_i128" class="fn">record_i128</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i128.html">i128</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_u128" class="fn">record_u128</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_bool" class="fn">record_bool</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_str" class="fn">record_str</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_bytes" class="fn">record_bytes</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>]) { ... }
|
||||
<span class="item-spacer"></span> fn <a href="#method.record_error" class="fn">record_error</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &(dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/error/trait.Error.html" title="trait core::error::Error">Error</a> + 'static)) { ... }
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Visits typed values.</p>
|
||||
<p>An instance of <code>Visit</code> (“a visitor”) represents the logic necessary to
|
||||
record field values of various types. When an implementor of <a href="../trait.Value.html" title="trait tracing::Value"><code>Value</code></a> is
|
||||
<a href="../trait.Value.html#tymethod.record" title="method tracing::Value::record">recorded</a>, it calls the appropriate method on the provided visitor to
|
||||
indicate the type that value should be recorded as.</p>
|
||||
<p>When a <a href="../trait.Subscriber.html" title="trait tracing::Subscriber"><code>Subscriber</code></a> implementation <a href="../trait.Subscriber.html#tymethod.event" title="method tracing::Subscriber::event">records an <code>Event</code></a> or a
|
||||
<a href="../trait.Subscriber.html#tymethod.record" title="method tracing::Subscriber::record">set of <code>Value</code>s added to a <code>Span</code></a>, it can pass an <code>&mut Visit</code> to the
|
||||
<code>record</code> method on the provided <a href="struct.ValueSet.html" title="struct tracing::field::ValueSet"><code>ValueSet</code></a> or <a href="../event/struct.Event.html" title="struct tracing::event::Event"><code>Event</code></a>. This visitor
|
||||
will then be used to record all the field-value pairs present on that
|
||||
<code>Event</code> or <code>ValueSet</code>.</p>
|
||||
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
|
||||
<p>A simple visitor that writes to a string might be implemented like so:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::fmt::{<span class="self">self</span>, Write};
|
||||
<span class="kw">use </span>tracing::field::{Value, Visit, Field};
|
||||
<span class="kw">pub struct </span>StringVisitor<<span class="lifetime">'a</span>> {
|
||||
string: <span class="kw-2">&</span><span class="lifetime">'a </span><span class="kw-2">mut </span>String,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span><<span class="lifetime">'a</span>> Visit <span class="kw">for </span>StringVisitor<<span class="lifetime">'a</span>> {
|
||||
<span class="kw">fn </span>record_debug(<span class="kw-2">&mut </span><span class="self">self</span>, field: <span class="kw-2">&</span>Field, value: <span class="kw-2">&</span><span class="kw">dyn </span>fmt::Debug) {
|
||||
<span class="macro">write!</span>(<span class="self">self</span>.string, <span class="string">"{} = {:?}; "</span>, field.name(), value).unwrap();
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>This visitor will format each recorded value using <code>fmt::Debug</code>, and
|
||||
append the field name and formatted value to the provided string,
|
||||
regardless of the type of the recorded value. When all the values have
|
||||
been recorded, the <code>StringVisitor</code> may be dropped, allowing the string
|
||||
to be printed or stored in some other data structure.</p>
|
||||
<p>The <code>Visit</code> trait provides default implementations for <code>record_i64</code>,
|
||||
<code>record_u64</code>, <code>record_bool</code>, <code>record_str</code>, and <code>record_error</code>, which simply
|
||||
forward the recorded value to <code>record_debug</code>. Thus, <code>record_debug</code> is the
|
||||
only method which a <code>Visit</code> implementation <em>must</em> implement. However,
|
||||
visitors may override the default implementations of these functions in
|
||||
order to implement type-specific behavior.</p>
|
||||
<p>Additionally, when a visitor receives a value of a type it does not care
|
||||
about, it is free to ignore those values completely. For example, a
|
||||
visitor which only records numeric data might look like this:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">pub struct </span>SumVisitor {
|
||||
sum: i64,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Visit <span class="kw">for </span>SumVisitor {
|
||||
<span class="kw">fn </span>record_i64(<span class="kw-2">&mut </span><span class="self">self</span>, _field: <span class="kw-2">&</span>Field, value: i64) {
|
||||
<span class="self">self</span>.sum += value;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>record_u64(<span class="kw-2">&mut </span><span class="self">self</span>, _field: <span class="kw-2">&</span>Field, value: u64) {
|
||||
<span class="self">self</span>.sum += value <span class="kw">as </span>i64;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>record_debug(<span class="kw-2">&mut </span><span class="self">self</span>, _field: <span class="kw-2">&</span>Field, _value: <span class="kw-2">&</span>fmt::Debug) {
|
||||
<span class="comment">// Do nothing
|
||||
</span>}
|
||||
}</code></pre></div>
|
||||
<p>This visitor (which is probably not particularly useful) keeps a running
|
||||
sum of all the numeric values it records, and ignores all other values. A
|
||||
more practical example of recording typed values is presented in
|
||||
<code>examples/counters.rs</code>, which demonstrates a very simple metrics system
|
||||
implemented using <code>tracing</code>.</p>
|
||||
<div class="example-wrap" style="display:inline-block">
|
||||
<pre class="ignore" style="white-space:normal;font:inherit;">
|
||||
<strong>Note</strong>: The <code>record_error</code> trait method is only
|
||||
available when the Rust standard library is present, as it requires the
|
||||
<code>std::error::Error</code> trait.
|
||||
</pre></div>
|
||||
</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_debug" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#331">Source</a><h4 class="code-header">fn <a href="#tymethod.record_debug" class="fn">record_debug</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>)</h4></section></summary><div class="docblock"><p>Visit a value implementing <code>fmt::Debug</code>.</p>
|
||||
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.record_f64" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#277">Source</a><h4 class="code-header">fn <a href="#method.record_f64" class="fn">record_f64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.f64.html">f64</a>)</h4></section></summary><div class="docblock"><p>Visit a double-precision floating point value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_i64" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#282">Source</a><h4 class="code-header">fn <a href="#method.record_i64" class="fn">record_i64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i64.html">i64</a>)</h4></section></summary><div class="docblock"><p>Visit a signed 64-bit integer value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_u64" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#287">Source</a><h4 class="code-header">fn <a href="#method.record_u64" class="fn">record_u64</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u64.html">u64</a>)</h4></section></summary><div class="docblock"><p>Visit an unsigned 64-bit integer value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_i128" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#292">Source</a><h4 class="code-header">fn <a href="#method.record_i128" class="fn">record_i128</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.i128.html">i128</a>)</h4></section></summary><div class="docblock"><p>Visit a signed 128-bit integer value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_u128" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#297">Source</a><h4 class="code-header">fn <a href="#method.record_u128" class="fn">record_u128</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u128.html">u128</a>)</h4></section></summary><div class="docblock"><p>Visit an unsigned 128-bit integer value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_bool" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#302">Source</a><h4 class="code-header">fn <a href="#method.record_bool" class="fn">record_bool</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>)</h4></section></summary><div class="docblock"><p>Visit a boolean value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_str" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#307">Source</a><h4 class="code-header">fn <a href="#method.record_str" class="fn">record_str</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>)</h4></section></summary><div class="docblock"><p>Visit a string value.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_bytes" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#312">Source</a><h4 class="code-header">fn <a href="#method.record_bytes" class="fn">record_bytes</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &[<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.u8.html">u8</a>])</h4></section></summary><div class="docblock"><p>Visit a byte slice.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="method.record_error" class="method"><a class="src rightside" href="../../src/tracing_core/field.rs.html#326">Source</a><h4 class="code-header">fn <a href="#method.record_error" class="fn">record_error</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &(dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/error/trait.Error.html" title="trait core::error::Error">Error</a> + 'static))</h4></section></summary><div class="docblock"><p>Records a type implementing <code>Error</code>.</p>
|
||||
<div class="example-wrap" style="display:inline-block">
|
||||
<pre class="ignore" style="white-space:normal;font:inherit;">
|
||||
<strong>Note</strong>: This is only enabled when the Rust standard library is
|
||||
present.
|
||||
</pre>
|
||||
</div></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-Visit-for-DebugMap%3C'a,+'b%3E" class="impl"><a class="src rightside" href="../../src/tracing_core/field.rs.html#416">Source</a><a href="#impl-Visit-for-DebugMap%3C'a,+'b%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'b> <a class="trait" href="trait.Visit.html" title="trait tracing::field::Visit">Visit</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/builders/struct.DebugMap.html" title="struct core::fmt::builders::DebugMap">DebugMap</a><'a, 'b></h3></section></summary><div class="impl-items"><section id="method.record_debug" class="method trait-impl"><a class="src rightside" href="../../src/tracing_core/field.rs.html#417">Source</a><a href="#method.record_debug" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record_debug" class="fn">record_debug</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Visit-for-DebugStruct%3C'a,+'b%3E" class="impl"><a class="src rightside" href="../../src/tracing_core/field.rs.html#410">Source</a><a href="#impl-Visit-for-DebugStruct%3C'a,+'b%3E" class="anchor">§</a><h3 class="code-header">impl<'a, 'b> <a class="trait" href="trait.Visit.html" title="trait tracing::field::Visit">Visit</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/builders/struct.DebugStruct.html" title="struct core::fmt::builders::DebugStruct">DebugStruct</a><'a, 'b></h3></section></summary><div class="impl-items"><section id="method.record_debug-1" class="method trait-impl"><a class="src rightside" href="../../src/tracing_core/field.rs.html#411">Source</a><a href="#method.record_debug-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record_debug" class="fn">record_debug</a>(&mut self, field: &<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, value: &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</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-Visit-for-F" class="impl"><a class="src rightside" href="../../src/tracing_core/field.rs.html#422-424">Source</a><a href="#impl-Visit-for-F" class="anchor">§</a><h3 class="code-header">impl<F> <a class="trait" href="trait.Visit.html" title="trait tracing::field::Visit">Visit</a> for F<div class="where">where
|
||||
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&<a class="struct" href="struct.Field.html" title="struct tracing::field::Field">Field</a>, &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>),</div></h3></section></div><script src="../../trait.impl/tracing_core/field/trait.Visit.js" data-ignore-extern-crates="core" async></script></section></div></main></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue