deploy: de38ae62916547ad097c066f94a32e9ba7790eeb

This commit is contained in:
NotAShelf 2025-02-05 00:10:33 +00:00
commit 9a86359447
28502 changed files with 1261284 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
<!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="`MakeVisitor` wrappers for working with `fmt::Debug` fields."><title>tracing_subscriber::field::debug - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module debug</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="../index.html">field</a></span><h1>Module <span>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_subscriber/field/debug.rs.html#1-111">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>MakeVisitor</code> wrappers for working with <code>fmt::Debug</code> fields.</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.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a></div><div class="desc docblock-short">A visitor wrapper that ensures any <code>fmt::Debug</code> fields are formatted using
the alternate (<code>:#</code>) formatter.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Alt"]};

File diff suppressed because one or more lines are too long

View 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="A `MakeVisitor` wrapper that separates formatted fields with a delimiter."><title>tracing_subscriber::field::delimited - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module delimited</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="../index.html">field</a></span><h1>Module <span>delimited</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_subscriber/field/delimited.rs.html#1-184">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <code>MakeVisitor</code> wrapper that separates formatted fields with a delimiter.</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.Delimited.html" title="struct tracing_subscriber::field::delimited::Delimited">Delimited</a></div><div class="desc docblock-short">A <code>MakeVisitor</code> wrapper that wraps a visitor that writes formatted output so
that a delimiter is inserted between writing formatted field values.</div></li><li><div class="item-name"><a class="struct" href="struct.VisitDelimited.html" title="struct tracing_subscriber::field::delimited::VisitDelimited">Visit<wbr>Delimited</a></div><div class="desc docblock-short">A visitor wrapper that inserts a delimiter after the wrapped visitor formats
a field value.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Delimited","VisitDelimited"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
<!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="`MakeVisitor` wrappers for working with `fmt::Display` fields."><title>tracing_subscriber::field::display - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module display</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="../index.html">field</a></span><h1>Module <span>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_subscriber/field/display.rs.html#1-117">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>MakeVisitor</code> wrappers for working with <code>fmt::Display</code> fields.</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.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a></div><div class="desc docblock-short">A visitor wrapper that ensures any strings named “message” are formatted
using <code>fmt::Display</code></div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Messages"]};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
<!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="Utilities for working with fields and field visitors."><title>tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module field</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tracing_<wbr>subscriber</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_subscriber</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_subscriber/field/mod.rs.html#1-365">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities for working with <a href="../../tracing_core/field/index.html" title="mod tracing_core::field">fields</a> and <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">field visitors</a>.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="debug/index.html" title="mod tracing_subscriber::field::debug">debug</a></div><div class="desc docblock-short"><code>MakeVisitor</code> wrappers for working with <code>fmt::Debug</code> fields.</div></li><li><div class="item-name"><a class="mod" href="delimited/index.html" title="mod tracing_subscriber::field::delimited">delimited</a></div><div class="desc docblock-short">A <code>MakeVisitor</code> wrapper that separates formatted fields with a delimiter.</div></li><li><div class="item-name"><a class="mod" href="display/index.html" title="mod tracing_subscriber::field::display">display</a></div><div class="desc docblock-short"><code>MakeVisitor</code> wrappers for working with <code>fmt::Display</code> fields.</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.MakeExt.html" title="trait tracing_subscriber::field::MakeExt">MakeExt</a></div><div class="desc docblock-short">Extension trait providing <code>MakeVisitor</code> combinators.</div></li><li><div class="item-name"><a class="trait" href="trait.MakeOutput.html" title="trait tracing_subscriber::field::MakeOutput">Make<wbr>Output</a></div><div class="desc docblock-short">Extension trait implemented for all <code>MakeVisitor</code> implementations that
produce a visitor implementing <code>VisitOutput</code>.</div></li><li><div class="item-name"><a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">Make<wbr>Visitor</a></div><div class="desc docblock-short">Creates new <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitors</a>.</div></li><li><div class="item-name"><a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">Record<wbr>Fields</a></div><div class="desc docblock-short">Extension trait implemented by types which can be recorded by a <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a>.</div></li><li><div class="item-name"><a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a></div><div class="desc docblock-short">Visits typed values.</div></li><li><div class="item-name"><a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">Visit<wbr>Fmt</a></div><div class="desc docblock-short">Extension trait implemented by visitors to indicate that they write to a
<code>fmt::Write</code> instance, and allow access to that writer.</div></li><li><div class="item-name"><a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">Visit<wbr>Output</a></div><div class="desc docblock-short">A <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a> that produces output once it has visited a set of fields.</div></li><li><div class="item-name"><a class="trait" href="trait.VisitWrite.html" title="trait tracing_subscriber::field::VisitWrite">Visit<wbr>Write</a></div><div class="desc docblock-short">Extension trait implemented by visitors to indicate that they write to an
<code>io::Write</code> instance, and allow access to that writer.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["debug","delimited","display"],"trait":["MakeExt","MakeOutput","MakeVisitor","RecordFields","Visit","VisitFmt","VisitOutput","VisitWrite"]};

View file

@ -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="Extension trait providing `MakeVisitor` combinators."><title>MakeExt in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">MakeExt</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.debug_alt" title="debug_alt">debug_alt</a></li><li><a href="#method.delimited" title="delimited">delimited</a></li><li><a href="#method.display_messages" title="display_messages">display_messages</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">MakeExt</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_subscriber/field/mod.rs.html#130-156">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeExt&lt;T&gt;<div class="where">where
Self: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + Sealed&lt;MakeExtMarker&lt;T&gt;&gt;,</div>{
// Provided methods
fn <a href="#method.debug_alt" class="fn">debug_alt</a>(self) -&gt; <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.display_messages" class="fn">display_messages</a>(self) -&gt; <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.delimited" class="fn">delimited</a>&lt;D&gt;(self, delimiter: D) -&gt; <a class="struct" href="delimited/struct.Delimited.html" title="struct tracing_subscriber::field::delimited::Delimited">Delimited</a>&lt;D, Self&gt;
<span class="where">where D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
Self::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait providing <code>MakeVisitor</code> combinators.</p>
</div></details><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.debug_alt" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#137-139">Source</a><h4 class="code-header">fn <a href="#method.debug_alt" class="fn">debug_alt</a>(self) -&gt; <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Wraps <code>self</code> so that any <code>fmt::Debug</code> fields are recorded using the
alternate formatter (<code>{:#?}</code>).</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.display_messages" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#143-145">Source</a><h4 class="code-header">fn <a href="#method.display_messages" class="fn">display_messages</a>(self) -&gt; <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Wraps <code>self</code> so that any string fields named “message” are recorded
using <code>fmt::Display</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.delimited" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#149-155">Source</a><h4 class="code-header">fn <a href="#method.delimited" class="fn">delimited</a>&lt;D&gt;(self, delimiter: D) -&gt; <a class="struct" href="delimited/struct.Delimited.html" title="struct tracing_subscriber::field::delimited::Delimited">Delimited</a>&lt;D, Self&gt;<div class="where">where
D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
Self::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,</div></h4></section></summary><div class="docblock"><p>Wraps <code>self</code> so that when fields are formatted to a writer, they are
separated by the provided <code>delimiter</code>.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-MakeExt%3CT%3E-for-M" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#220-225">Source</a><a href="#impl-MakeExt%3CT%3E-for-M" class="anchor">§</a><h3 class="code-header">impl&lt;T, M&gt; <a class="trait" href="trait.MakeExt.html" title="trait tracing_subscriber::field::MakeExt">MakeExt</a>&lt;T&gt; for M<div class="where">where
M: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + Sealed&lt;MakeExtMarker&lt;T&gt;&gt;,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/field/trait.MakeExt.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,14 @@
<!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="Extension trait implemented for all `MakeVisitor` implementations that produce a visitor implementing `VisitOutput`."><title>MakeOutput in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Output</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.visit_with" title="visit_with">visit_with</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">MakeOutput</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_subscriber/field/mod.rs.html#95-108">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeOutput&lt;T, Out&gt;<div class="where">where
Self: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; + Sealed&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.tuple.html">(T, Out)</a>&gt;,
Self::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;Out&gt;,</div>{
// Provided method
fn <a href="#method.visit_with" class="fn">visit_with</a>&lt;F&gt;(&amp;self, target: T, fields: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;F</a>) -&gt; Out
<span class="where">where F: <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait implemented for all <code>MakeVisitor</code> implementations that
produce a visitor implementing <code>VisitOutput</code>.</p>
</div></details><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.visit_with" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#102-107">Source</a><h4 class="code-header">fn <a href="#method.visit_with" class="fn">visit_with</a>&lt;F&gt;(&amp;self, target: T, fields: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;F</a>) -&gt; Out<div class="where">where
F: <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>,</div></h4></section></summary><div class="docblock"><p>Visits all fields in <code>fields</code> with a new visitor constructed from
<code>target</code>.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-MakeOutput%3CT,+Out%3E-for-M" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#211-216">Source</a><a href="#impl-MakeOutput%3CT,+Out%3E-for-M" class="anchor">§</a><h3 class="code-header">impl&lt;T, Out, M&gt; <a class="trait" href="trait.MakeOutput.html" title="trait tracing_subscriber::field::MakeOutput">MakeOutput</a>&lt;T, Out&gt; for M<div class="where">where
M: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;,
M::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;Out&gt;,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/field/trait.MakeOutput.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,24 @@
<!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="Creates new visitors."><title>MakeVisitor in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Make<wbr>Visitor</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Visitor" title="Visitor">Visitor</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_visitor" title="make_visitor">make_visitor</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">MakeVisitor</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_subscriber/field/mod.rs.html#26-32">Source</a> </span></div><pre class="rust item-decl"><code>pub trait MakeVisitor&lt;T&gt; {
type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a>: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>;
// Required method
fn <a href="#tymethod.make_visitor" class="fn">make_visitor</a>(&amp;self, target: T) -&gt; Self::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Creates new <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitors</a>.</p>
<p>A type implementing <code>MakeVisitor</code> represents a composable factory for types
implementing the <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit"><code>Visit</code> trait</a>. The <code>MakeVisitor</code> trait defines
a single function, <code>make_visitor</code>, which takes in a <code>T</code>-typed <code>target</code> and
returns a type implementing <code>Visit</code> configured for that target. A target may
be a string, output stream, or data structure that the visitor will record
data to, configuration variables that determine the visitors behavior, or
<code>()</code> when no input is required to produce a visitor.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Visitor" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#28">Source</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a>: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a></h4></section></summary><div class="docblock"><p>The visitor type produced by this <code>MakeVisitor</code>.</p>
</div></details></div><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.make_visitor" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#31">Source</a><h4 class="code-header">fn <a href="#tymethod.make_visitor" class="fn">make_visitor</a>(&amp;self, target: T) -&gt; Self::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a></h4></section></summary><div class="docblock"><p>Make a new visitor for the provided <code>target</code>.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-DefaultFields" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1205-1212">Source</a><a href="#impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-DefaultFields" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;<a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;&gt; for <a class="struct" href="../fmt/format/struct.DefaultFields.html" title="struct tracing_subscriber::fmt::format::DefaultFields">DefaultFields</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1206">Source</a><a href="#associatedtype.Visitor-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="../fmt/format/struct.DefaultVisitor.html" title="struct tracing_subscriber::fmt::format::DefaultVisitor">DefaultVisitor</a>&lt;'a&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-PrettyFields" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/pretty.rs.html#387-397">Source</a><a href="#impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-PrettyFields" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;<a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;&gt; for <a class="struct" href="../fmt/format/struct.PrettyFields.html" title="struct tracing_subscriber::fmt::format::PrettyFields">PrettyFields</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/pretty.rs.html#388">Source</a><a href="#associatedtype.Visitor-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="../fmt/format/struct.PrettyVisitor.html" title="struct tracing_subscriber::fmt::format::PrettyVisitor">PrettyVisitor</a>&lt;'a&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-FieldFn%3CF%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1525-1538">Source</a><a href="#impl-MakeVisitor%3CWriter%3C'a%3E%3E-for-FieldFn%3CF%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, F&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;<a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;&gt; for <a class="struct" href="../fmt/format/struct.FieldFn.html" title="struct tracing_subscriber::fmt::format::FieldFn">FieldFn</a>&lt;F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;, &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1529">Source</a><a href="#associatedtype.Visitor-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="../fmt/format/struct.FieldFnVisitor.html" title="struct tracing_subscriber::fmt::format::FieldFnVisitor">FieldFnVisitor</a>&lt;'a, F&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CT%3E-for-Delimited%3CD,+V%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/delimited.rs.html#27-38">Source</a><a href="#impl-MakeVisitor%3CT%3E-for-Delimited%3CD,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;D, V, T&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; for <a class="struct" href="delimited/struct.Delimited.html" title="struct tracing_subscriber::field::delimited::Delimited">Delimited</a>&lt;D, V&gt;<div class="where">where
D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
V: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;,
V::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-4" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/delimited.rs.html#33">Source</a><a href="#associatedtype.Visitor-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="delimited/struct.VisitDelimited.html" title="struct tracing_subscriber::field::delimited::VisitDelimited">VisitDelimited</a>&lt;D, &lt;V as <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;&gt;::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CT%3E-for-Alt%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#25-35">Source</a><a href="#impl-MakeVisitor%3CT%3E-for-Alt%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, V&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; for <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-5" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#29">Source</a><a href="#associatedtype.Visitor-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;&lt;V as <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;&gt;::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CT%3E-for-Messages%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#27-37">Source</a><a href="#impl-MakeVisitor%3CT%3E-for-Messages%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, V&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; for <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-6" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#31">Source</a><a href="#associatedtype.Visitor-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;&lt;V as <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt;&gt;::<a class="associatedtype" href="trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeVisitor%3CT%3E-for-F" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#193-202">Source</a><a href="#impl-MakeVisitor%3CT%3E-for-F" class="anchor">§</a><h3 class="code-header">impl&lt;T, V, F&gt; <a class="trait" href="trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor">MakeVisitor</a>&lt;T&gt; for F<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(T) -&gt; V,
V: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Visitor-7" class="associatedtype trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#198">Source</a><a href="#associatedtype.Visitor-7" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Visitor" class="associatedtype">Visitor</a> = V</h4></section></div></details></div><script src="../../trait.impl/tracing_subscriber/field/trait.MakeVisitor.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,30 @@
<!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="Extension trait implemented by types which can be recorded by a visitor."><title>RecordFields in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Record<wbr>Fields</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.record" title="record">record</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-RecordFields-for-%26F" title="&#38;F">&#38;F</a></li><li><a href="#impl-RecordFields-for-Attributes%3C'_%3E" title="Attributes&#60;&#39;_&#62;">Attributes&#60;&#39;_&#62;</a></li><li><a href="#impl-RecordFields-for-Event%3C'_%3E" title="Event&#60;&#39;_&#62;">Event&#60;&#39;_&#62;</a></li><li><a href="#impl-RecordFields-for-Record%3C'_%3E" title="Record&#60;&#39;_&#62;">Record&#60;&#39;_&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">RecordFields</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_subscriber/field/mod.rs.html#88-91">Source</a> </span></div><pre class="rust item-decl"><code>pub trait RecordFields: Sealed&lt;RecordFieldsMarker&gt; {
// Required method
fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>);
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait implemented by types which can be recorded by a <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a>.</p>
<p>This allows writing code that is generic over <code>tracing_core</code>s
<a href="../../tracing_core/span/struct.Attributes.html" title="struct tracing_core::span::Attributes"><code>span::Attributes</code></a>, <a href="../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record"><code>span::Record</code></a>, and <a href="../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event"><code>Event</code></a>
types. These types all provide inherent <code>record</code> methods that allow a
visitor to record their fields, but there is no common trait representing this.</p>
<p>With <code>RecordFields</code>, we can write code like this:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_core::field::Visit;
<span class="kw">use </span>tracing_subscriber::field::RecordFields;
<span class="kw">struct </span>MyVisitor {
<span class="comment">// ...
</span>}
<span class="kw">impl </span>Visit <span class="kw">for </span>MyVisitor {
<span class="comment">// ...
</span>}
<span class="kw">fn </span>record_with_my_visitor&lt;R&gt;(r: R)
<span class="kw">where
</span>R: RecordFields,
{
<span class="kw">let </span><span class="kw-2">mut </span>visitor = MyVisitor::new();
r.record(<span class="kw-2">&amp;mut </span>visitor);
}</code></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" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#90">Source</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>)</h4></section></summary><div class="docblock"><p>Record all the fields in <code>self</code> with the provided <code>visitor</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-RecordFields-for-Event%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#161-165">Source</a><a href="#impl-RecordFields-for-Event%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a> for <a class="struct" href="../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a>&lt;'_&gt;</h3></section></summary><div class="impl-items"><section id="method.record" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#162-164">Source</a><a href="#method.record" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordFields-for-Attributes%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#168-172">Source</a><a href="#impl-RecordFields-for-Attributes%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a> for <a class="struct" href="../../tracing_core/span/struct.Attributes.html" title="struct tracing_core::span::Attributes">Attributes</a>&lt;'_&gt;</h3></section></summary><div class="impl-items"><section id="method.record-1" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#169-171">Source</a><a href="#method.record-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordFields-for-Record%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#175-179">Source</a><a href="#impl-RecordFields-for-Record%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a> for <a class="struct" href="../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record">Record</a>&lt;'_&gt;</h3></section></summary><div class="impl-items"><section id="method.record-2" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#176-178">Source</a><a href="#method.record-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>)</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordFields-for-%26F" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#182-189">Source</a><a href="#impl-RecordFields-for-%26F" class="anchor">§</a><h3 class="code-header">impl&lt;F&gt; <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;F</a><div class="where">where
F: <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>,</div></h3></section></summary><div class="impl-items"><section id="method.record-3" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#186-188">Source</a><a href="#method.record-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.record" class="fn">record</a>(&amp;self, visitor: &amp;mut dyn <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::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"></div><script src="../../trait.impl/tracing_subscriber/field/trait.RecordFields.js" data-ignore-extern-crates="tracing_core" async></script></section></div></main></body></html>

View file

@ -0,0 +1,103 @@
<!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_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</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&#60;&#39;a, &#39;b&#62;">DebugMap&#60;&#39;a, &#39;b&#62;</a></li><li><a href="#impl-Visit-for-DebugStruct%3C'a,+'b%3E" title="DebugStruct&#60;&#39;a, &#39;b&#62;">DebugStruct&#60;&#39;a, &#39;b&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;<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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;[<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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;(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="../../tracing_core/field/trait.Value.html" title="trait tracing_core::field::Value"><code>Value</code></a> is
<a href="../../tracing_core/field/trait.Value.html#tymethod.record" title="method tracing_core::field::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="../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> implementation <a href="../../tracing_core/subscriber/trait.Subscriber.html#tymethod.event" title="method tracing_core::subscriber::Subscriber::event">records an <code>Event</code></a> or a
<a href="../../tracing_core/subscriber/trait.Subscriber.html#tymethod.record" title="method tracing_core::subscriber::Subscriber::record">set of <code>Value</code>s added to a <code>Span</code></a>, it can pass an <code>&amp;mut Visit</code> to the
<code>record</code> method on the provided <a href="../../tracing_core/field/struct.ValueSet.html" title="struct tracing_core::field::ValueSet"><code>ValueSet</code></a> or <a href="../../tracing_core/event/struct.Event.html" title="struct tracing_core::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&lt;<span class="lifetime">'a</span>&gt; {
string: <span class="kw-2">&amp;</span><span class="lifetime">'a </span><span class="kw-2">mut </span>String,
}
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>&gt; Visit <span class="kw">for </span>StringVisitor&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">fn </span>record_debug(<span class="kw-2">&amp;mut </span><span class="self">self</span>, field: <span class="kw-2">&amp;</span>Field, value: <span class="kw-2">&amp;</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">&amp;mut </span><span class="self">self</span>, _field: <span class="kw-2">&amp;</span>Field, value: i64) {
<span class="self">self</span>.sum += value;
}
<span class="kw">fn </span>record_u64(<span class="kw-2">&amp;mut </span><span class="self">self</span>, _field: <span class="kw-2">&amp;</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">&amp;mut </span><span class="self">self</span>, _field: <span class="kw-2">&amp;</span>Field, _value: <span class="kw-2">&amp;</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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;<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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;[<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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;(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&lt;'a, 'b&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::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>&lt;'a, 'b&gt;</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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;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&lt;'a, 'b&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::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>&lt;'a, 'b&gt;</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>(&amp;mut self, field: &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, value: &amp;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-DefaultVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1240-1299">Source</a><a href="#impl-Visit-for-DefaultVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="../fmt/format/struct.DefaultVisitor.html" title="struct tracing_subscriber::fmt::format::DefaultVisitor">DefaultVisitor</a>&lt;'_&gt;</h3></section><section id="impl-Visit-for-PrettyVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/pretty.rs.html#440-498">Source</a><a href="#impl-Visit-for-PrettyVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="../fmt/format/struct.PrettyVisitor.html" title="struct tracing_subscriber::fmt::format::PrettyVisitor">PrettyVisitor</a>&lt;'_&gt;</h3></section><section id="impl-Visit-for-FieldFnVisitor%3C'a,+F%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1540-1549">Source</a><a href="#impl-Visit-for-FieldFnVisitor%3C'a,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, F&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="../fmt/format/struct.FieldFnVisitor.html" title="struct tracing_subscriber::fmt::format::FieldFnVisitor">FieldFnVisitor</a>&lt;'a, F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;, &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>,</div></h3></section><section id="impl-Visit-for-VisitDelimited%3CD,+V%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/delimited.rs.html#83-112">Source</a><a href="#impl-Visit-for-VisitDelimited%3CD,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;D, V&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="delimited/struct.VisitDelimited.html" title="struct tracing_subscriber::field::delimited::VisitDelimited">VisitDelimited</a>&lt;D, V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,
D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt;,</div></h3></section><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&lt;F&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::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>(&amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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><section id="impl-Visit-for-Alt%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#37-75">Source</a><a href="#impl-Visit-for-Alt%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a>,</div></h3></section><section id="impl-Visit-for-Messages%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#39-81">Source</a><a href="#impl-Visit-for-Messages%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> for <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</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>

View file

@ -0,0 +1,12 @@
<!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="Extension trait implemented by visitors to indicate that they write to a `fmt::Write` instance, and allow access to that writer."><title>VisitFmt in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Visit<wbr>Fmt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.writer" title="writer">writer</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">VisitFmt</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_subscriber/field/mod.rs.html#124-127">Source</a> </span></div><pre class="rust item-decl"><code>pub trait VisitFmt: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>&gt; {
// Required method
fn <a href="#tymethod.writer" class="fn">writer</a>(&amp;mut self) -&gt; &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Write.html" title="trait core::fmt::Write">Write</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait implemented by visitors to indicate that they write to a
<code>fmt::Write</code> instance, and allow access to that writer.</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.writer" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#126">Source</a><h4 class="code-header">fn <a href="#tymethod.writer" class="fn">writer</a>(&amp;mut self) -&gt; &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Write.html" title="trait core::fmt::Write">Write</a></h4></section></summary><div class="docblock"><p>Returns the formatter that this visitor writes to.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-VisitFmt-for-DefaultVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1307-1311">Source</a><a href="#impl-VisitFmt-for-DefaultVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="../fmt/format/struct.DefaultVisitor.html" title="struct tracing_subscriber::fmt::format::DefaultVisitor">DefaultVisitor</a>&lt;'_&gt;</h3></section><section id="impl-VisitFmt-for-PrettyVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/pretty.rs.html#507-511">Source</a><a href="#impl-VisitFmt-for-PrettyVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="../fmt/format/struct.PrettyVisitor.html" title="struct tracing_subscriber::fmt::format::PrettyVisitor">PrettyVisitor</a>&lt;'_&gt;</h3></section><section id="impl-VisitFmt-for-FieldFnVisitor%3C'a,+F%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1560-1567">Source</a><a href="#impl-VisitFmt-for-FieldFnVisitor%3C'a,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, F&gt; <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="../fmt/format/struct.FieldFnVisitor.html" title="struct tracing_subscriber::fmt::format::FieldFnVisitor">FieldFnVisitor</a>&lt;'a, F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;, &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>,</div></h3></section><section id="impl-VisitFmt-for-VisitDelimited%3CD,+V%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/delimited.rs.html#125-133">Source</a><a href="#impl-VisitFmt-for-VisitDelimited%3CD,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;D, V&gt; <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="delimited/struct.VisitDelimited.html" title="struct tracing_subscriber::field::delimited::VisitDelimited">VisitDelimited</a>&lt;D, V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,
D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt;,</div></h3></section><section id="impl-VisitFmt-for-Alt%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#103-111">Source</a><a href="#impl-VisitFmt-for-Alt%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,</div></h3></section><section id="impl-VisitFmt-for-Messages%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#109-117">Source</a><a href="#impl-VisitFmt-for-Messages%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> for <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/field/trait.VisitFmt.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,21 @@
<!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 visitor that produces output once it has visited a set of fields."><title>VisitOutput in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Visit<wbr>Output</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.finish" title="finish">finish</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.visit" title="visit">visit</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">VisitOutput</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_subscriber/field/mod.rs.html#37-53">Source</a> </span></div><pre class="rust item-decl"><code>pub trait VisitOutput&lt;Out&gt;: <a class="trait" href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">Visit</a> {
// Required method
fn <a href="#tymethod.finish" class="fn">finish</a>(self) -&gt; Out;
// Provided method
fn <a href="#method.visit" class="fn">visit</a>&lt;R&gt;(self, fields: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;R</a>) -&gt; Out
<span class="where">where R: <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>,
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <a href="trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a> that produces output once it has visited a set of fields.</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.finish" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#41">Source</a><h4 class="code-header">fn <a href="#tymethod.finish" class="fn">finish</a>(self) -&gt; Out</h4></section></summary><div class="docblock"><p>Completes the visitor, returning any output.</p>
<p>This is called once a full set of fields has been visited.</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.visit" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#45-52">Source</a><h4 class="code-header">fn <a href="#method.visit" class="fn">visit</a>&lt;R&gt;(self, fields: <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.reference.html">&amp;R</a>) -&gt; Out<div class="where">where
R: <a class="trait" href="trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>,
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Visit a set of fields, and return the output of finishing the visitor
once the fields have been visited.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-DefaultVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1301-1305">Source</a><a href="#impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-DefaultVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;&gt; for <a class="struct" href="../fmt/format/struct.DefaultVisitor.html" title="struct tracing_subscriber::fmt::format::DefaultVisitor">DefaultVisitor</a>&lt;'_&gt;</h3></section><section id="impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-PrettyVisitor%3C'_%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/pretty.rs.html#500-505">Source</a><a href="#impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-PrettyVisitor%3C'_%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;&gt; for <a class="struct" href="../fmt/format/struct.PrettyVisitor.html" title="struct tracing_subscriber::fmt::format::PrettyVisitor">PrettyVisitor</a>&lt;'_&gt;</h3></section><section id="impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-FieldFnVisitor%3C'a,+F%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/format/mod.rs.html#1551-1558">Source</a><a href="#impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-FieldFnVisitor%3C'a,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, F&gt; <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;&gt; for <a class="struct" href="../fmt/format/struct.FieldFnVisitor.html" title="struct tracing_subscriber::fmt::format::FieldFnVisitor">FieldFnVisitor</a>&lt;'a, F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../fmt/format/struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'a&gt;, &amp;<a class="struct" href="../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>,</div></h3></section><section id="impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-VisitDelimited%3CD,+V%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/delimited.rs.html#114-123">Source</a><a href="#impl-VisitOutput%3CResult%3C(),+Error%3E%3E-for-VisitDelimited%3CD,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;D, V&gt; <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;&gt; for <a class="struct" href="delimited/struct.VisitDelimited.html" title="struct tracing_subscriber::field::delimited::VisitDelimited">VisitDelimited</a>&lt;D, V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a>,
D: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.str.html">str</a>&gt;,</div></h3></section><section id="impl-VisitOutput%3CO%3E-for-Alt%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#77-85">Source</a><a href="#impl-VisitOutput%3CO%3E-for-Alt%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V, O&gt; <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;O&gt; for <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;O&gt;,</div></h3></section><section id="impl-VisitOutput%3CO%3E-for-Messages%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#83-91">Source</a><a href="#impl-VisitOutput%3CO%3E-for-Messages%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V, O&gt; <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;O&gt; for <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;O&gt;,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/field/trait.VisitOutput.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!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="Extension trait implemented by visitors to indicate that they write to an `io::Write` instance, and allow access to that writer."><title>VisitWrite in tracing_subscriber::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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Visit<wbr>Write</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.writer" title="writer">writer</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<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_subscriber</a>::<wbr><a href="index.html">field</a></span><h1>Trait <span class="trait">VisitWrite</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_subscriber/field/mod.rs.html#116-119">Source</a> </span></div><pre class="rust item-decl"><code>pub trait VisitWrite: <a class="trait" href="trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;&gt; {
// Required method
fn <a href="#tymethod.writer" class="fn">writer</a>(&amp;mut self) -&gt; &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html" title="trait std::io::Write">Write</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait implemented by visitors to indicate that they write to an
<code>io::Write</code> instance, and allow access to that writer.</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.writer" class="method"><a class="src rightside" href="../../src/tracing_subscriber/field/mod.rs.html#118">Source</a><h4 class="code-header">fn <a href="#tymethod.writer" class="fn">writer</a>(&amp;mut self) -&gt; &amp;mut dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/std/io/trait.Write.html" title="trait std::io::Write">Write</a></h4></section></summary><div class="docblock"><p>Returns the writer that this visitor writes to.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-VisitWrite-for-Alt%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/debug.rs.html#92-100">Source</a><a href="#impl-VisitWrite-for-Alt%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.VisitWrite.html" title="trait tracing_subscriber::field::VisitWrite">VisitWrite</a> for <a class="struct" href="debug/struct.Alt.html" title="struct tracing_subscriber::field::debug::Alt">Alt</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitWrite.html" title="trait tracing_subscriber::field::VisitWrite">VisitWrite</a>,</div></h3></section><section id="impl-VisitWrite-for-Messages%3CV%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/field/display.rs.html#98-106">Source</a><a href="#impl-VisitWrite-for-Messages%3CV%3E" class="anchor">§</a><h3 class="code-header">impl&lt;V&gt; <a class="trait" href="trait.VisitWrite.html" title="trait tracing_subscriber::field::VisitWrite">VisitWrite</a> for <a class="struct" href="display/struct.Messages.html" title="struct tracing_subscriber::field::display::Messages">Messages</a>&lt;V&gt;<div class="where">where
V: <a class="trait" href="trait.VisitWrite.html" title="trait tracing_subscriber::field::VisitWrite">VisitWrite</a>,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/field/trait.VisitWrite.js" async></script></section></div></main></body></html>

View 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="Filter combinators"><title>tracing_subscriber::filter::combinator - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module combinator</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tracing_<wbr>subscriber::<wbr>filter</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_subscriber</a>::<wbr><a href="../index.html">filter</a></span><h1>Module <span>combinator</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_subscriber/filter/layer_filters/combinator.rs.html#1-542">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Filter combinators</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.And.html" title="struct tracing_subscriber::filter::combinator::And">And</a></div><div class="desc docblock-short">Combines two <a href="../../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>s so that spans and events are enabled if and only if
<em>both</em> filters return <code>true</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Not.html" title="struct tracing_subscriber::filter::combinator::Not">Not</a></div><div class="desc docblock-short">Inverts the result of a <a href="../../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Or.html" title="struct tracing_subscriber::filter::combinator::Or">Or</a></div><div class="desc docblock-short">Combines two <a href="../../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>s so that spans and events are enabled if <em>either</em> filter
returns <code>true</code>.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["And","Not","Or"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.ParseError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.ParseError.html">../../../tracing_subscriber/filter/struct.ParseError.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.ParseError.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/fn.dynamic_filter_fn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/fn.dynamic_filter_fn.html">../../../tracing_subscriber/filter/fn.dynamic_filter_fn.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/fn.dynamic_filter_fn.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/fn.filter_fn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/fn.filter_fn.html">../../../tracing_subscriber/filter/fn.filter_fn.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/fn.filter_fn.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.DynFilterFn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.DynFilterFn.html">../../../tracing_subscriber/filter/struct.DynFilterFn.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.DynFilterFn.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.FilterFn.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.FilterFn.html">../../../tracing_subscriber/filter/struct.FilterFn.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.FilterFn.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,49 @@
<!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="Constructs a `DynFilterFn` from a function or closure that returns `true` if a span or event should be enabled within a particular span context."><title>dynamic_filter_fn in tracing_subscriber::filter - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">dynamic_<wbr>filter_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>filter</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_subscriber</a>::<wbr><a href="index.html">filter</a></span><h1>Function <span class="fn">dynamic_filter_fn</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_subscriber/filter/filter_fn.rs.html#175-180">Source</a> </span></div><pre class="rust item-decl"><code>pub fn dynamic_filter_fn&lt;S, F&gt;(f: F) -&gt; <a class="struct" href="struct.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn">DynFilterFn</a>&lt;S, F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;<a class="struct" href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata">Metadata</a>&lt;'_&gt;, &amp;<a class="struct" href="../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context">Context</a>&lt;'_, S&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constructs a <a href="struct.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn"><code>DynFilterFn</code></a> from a function or closure that returns <code>true</code>
if a span or event should be enabled within a particular <a href="../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context">span context</a>.</p>
<p>This is equivalent to calling <a href="struct.DynFilterFn.html#method.new" title="associated function tracing_subscriber::filter::DynFilterFn::new"><code>DynFilterFn::new</code></a>.</p>
<p>Unlike <a href="fn.filter_fn.html" title="fn tracing_subscriber::filter::filter_fn"><code>filter_fn</code></a>, this function takes a closure or function pointer
taking the <a href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata"><code>Metadata</code></a> for a span or event <em>and</em> the current <a href="../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context"><code>Context</code></a>.
This means that a <a href="struct.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn"><code>DynFilterFn</code></a> can choose whether to enable spans or
events based on information about the <em>current</em> span (or its parents).</p>
<p>If this is <em>not</em> necessary, use <a href="fn.filter_fn.html" title="fn tracing_subscriber::filter::filter_fn"><code>filter_fn</code></a> instead.</p>
<p>The returned <a href="struct.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn"><code>DynFilterFn</code></a> can be used for both <a href="../layer/index.html#per-layer-filtering" title="mod tracing_subscriber::layer">per-layer filtering</a>
(using its <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> implementation) and <a href="../layer/index.html#global-filtering" title="mod tracing_subscriber::layer">global filtering</a> (using
its <a href="../layer/trait.Layer.html" title="trait tracing_subscriber::layer::Layer"><code>Layer</code></a> implementation).</p>
<p>See the <a href="../layer/index.html#filtering-with-layers" title="mod tracing_subscriber::layer">documentation on filtering with layers</a> for details.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
layer::{Layer, SubscriberExt},
filter,
util::SubscriberInitExt,
};
<span class="comment">// Only enable spans or events within a span named "interesting_span".
</span><span class="kw">let </span>my_filter = filter::dynamic_filter_fn(|metadata, cx| {
<span class="comment">// If this *is* "interesting_span", make sure to enable it.
</span><span class="kw">if </span>metadata.is_span() &amp;&amp; metadata.name() == <span class="string">"interesting_span" </span>{
<span class="kw">return </span><span class="bool-val">true</span>;
}
<span class="comment">// Otherwise, are we in an interesting span?
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(current_span) = cx.lookup_current() {
<span class="kw">return </span>current_span.name() == <span class="string">"interesting_span"</span>;
}
<span class="bool-val">false
</span>});
<span class="kw">let </span>my_layer = tracing_subscriber::fmt::layer();
tracing_subscriber::registry()
.with(my_layer.with_filter(my_filter))
.init();
<span class="comment">// This event will not be enabled.
</span><span class="macro">tracing::info!</span>(<span class="string">"something happened"</span>);
<span class="macro">tracing::info_span!</span>(<span class="string">"interesting_span"</span>).in_scope(|| {
<span class="comment">// This event will be enabled.
</span><span class="macro">tracing::debug!</span>(<span class="string">"something else happened"</span>);
});</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,32 @@
<!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="Constructs a `FilterFn`, from a function or closure that returns `true` if a span or event should be enabled, based on its `Metadata`."><title>filter_fn in tracing_subscriber::filter - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">filter_<wbr>fn</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>filter</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_subscriber</a>::<wbr><a href="index.html">filter</a></span><h1>Function <span class="fn">filter_fn</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_subscriber/filter/filter_fn.rs.html#104-109">Source</a> </span></div><pre class="rust item-decl"><code>pub fn filter_fn&lt;F&gt;(f: F) -&gt; <a class="struct" href="struct.FilterFn.html" title="struct tracing_subscriber::filter::FilterFn">FilterFn</a>&lt;F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;<a class="struct" href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata">Metadata</a>&lt;'_&gt;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.bool.html">bool</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constructs a <a href="struct.FilterFn.html" title="struct tracing_subscriber::filter::FilterFn"><code>FilterFn</code></a>, from a function or closure that returns <code>true</code> if
a span or event should be enabled, based on its <a href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata"><code>Metadata</code></a>.</p>
<p>The returned <a href="struct.FilterFn.html" title="struct tracing_subscriber::filter::FilterFn"><code>FilterFn</code></a> can be used for both <a href="../layer/index.html#per-layer-filtering" title="mod tracing_subscriber::layer">per-layer filtering</a>
(using its <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> implementation) and <a href="../layer/index.html#global-filtering" title="mod tracing_subscriber::layer">global filtering</a> (using
its <a href="../layer/trait.Layer.html" title="trait tracing_subscriber::layer::Layer"><code>Layer</code></a> implementation).</p>
<p>See the <a href="../layer/index.html#filtering-with-layers" title="mod tracing_subscriber::layer">documentation on filtering with layers</a> for details.</p>
<p>This is equivalent to calling <a href="struct.FilterFn.html#method.new" title="associated function tracing_subscriber::filter::FilterFn::new"><code>FilterFn::new</code></a>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
layer::{Layer, SubscriberExt},
filter,
util::SubscriberInitExt,
};
<span class="kw">let </span>my_filter = filter::filter_fn(|metadata| {
<span class="comment">// Only enable spans or events with the target "interesting_things"
</span>metadata.target() == <span class="string">"interesting_things"
</span>});
<span class="kw">let </span>my_layer = tracing_subscriber::fmt::layer();
tracing_subscriber::registry()
.with(my_layer.with_filter(my_filter))
.init();
<span class="comment">// This event will not be enabled.
</span><span class="macro">tracing::warn!</span>(<span class="string">"something important but uninteresting happened!"</span>);
<span class="comment">// This event will be enabled.
</span><span class="macro">tracing::debug!</span>(target: <span class="string">"interesting_things"</span>, <span class="string">"an interesting minor detail..."</span>);</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,15 @@
<!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="`Layer`s that control which spans and events are enabled by the wrapped subscriber."><title>tracing_subscriber::filter - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module filter</a></h2><h3><a href="#reexports">Module Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><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_<wbr>subscriber</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_subscriber</a></span><h1>Module <span>filter</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_subscriber/filter/mod.rs.html#1-66">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="../layer/index.html" title="mod tracing_subscriber::layer"><code>Layer</code></a>s that control which spans and events are enabled by the wrapped
subscriber.</p>
<p>This module contains a number of types that provide implementations of
various strategies for filtering which spans and events are enabled. For
details on filtering spans and events using <a href="../layer/index.html" title="mod tracing_subscriber::layer"><code>Layer</code></a>s, see the
<a href="../layer/index.html#filtering-with-layers" title="mod tracing_subscriber::layer"><code>layer</code> modules documentation</a>.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.Targets"><code>pub use self::targets::<a class="struct" href="targets/struct.Targets.html" title="struct tracing_subscriber::filter::targets::Targets">Targets</a>;</code></div></li></ul><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="combinator/index.html" title="mod tracing_subscriber::filter::combinator">combinator</a></div><div class="desc docblock-short">Filter combinators</div></li><li><div class="item-name"><a class="mod" href="targets/index.html" title="mod tracing_subscriber::filter::targets">targets</a></div><div class="desc docblock-short">A <a href="../layer/index.html#filtering-with-layers" title="mod tracing_subscriber::layer">filter</a> that enables or disables spans and events based on their <a href="../../tracing_core/metadata/struct.Metadata.html#method.target" title="method tracing_core::metadata::Metadata::target">target</a> and <a href="../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level">level</a>.</div></li></ul><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.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn">DynFilter<wbr>Fn</a></div><div class="desc docblock-short">A filter implemented by a closure or function pointer that
determines whether a given span or event is enabled <em>dynamically</em>,
potentially based on the current <a href="../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context">span context</a>.</div></li><li><div class="item-name"><a class="struct" href="struct.FilterFn.html" title="struct tracing_subscriber::filter::FilterFn">Filter<wbr>Fn</a></div><div class="desc docblock-short">A filter implemented by a closure or function pointer that
determines whether a given span or event is enabled, based on its
<a href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata"><code>Metadata</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.FilterId.html" title="struct tracing_subscriber::filter::FilterId">Filter<wbr>Id</a></div><div class="desc docblock-short">Uniquely identifies an individual <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> instance in the context of
a <a href="../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Filtered.html" title="struct tracing_subscriber::filter::Filtered">Filtered</a></div><div class="desc docblock-short">A <a href="../layer/trait.Layer.html" title="trait tracing_subscriber::layer::Layer"><code>Layer</code></a> that wraps an inner <a href="../layer/trait.Layer.html" title="trait tracing_subscriber::layer::Layer"><code>Layer</code></a> and adds a <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> which
controls what spans and events are enabled for that layer.</div></li><li><div class="item-name"><a class="struct" href="struct.LevelFilter.html" title="struct tracing_subscriber::filter::LevelFilter">Level<wbr>Filter</a></div><div class="desc docblock-short">A filter comparable to a verbosity <a href="../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level"><code>Level</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.LevelParseError.html" title="struct tracing_subscriber::filter::LevelParseError">Level<wbr>Parse<wbr>Error</a></div><div class="desc docblock-short">Indicates that a string could not be parsed to a valid level.</div></li><li><div class="item-name"><a class="struct" href="struct.ParseError.html" title="struct tracing_subscriber::filter::ParseError">Parse<wbr>Error</a></div><div class="desc docblock-short">Indicates that a string could not be parsed as a filtering directive.</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.FilterExt.html" title="trait tracing_subscriber::filter::FilterExt">Filter<wbr>Ext</a></div><div class="desc docblock-short">Extension trait adding <a href="combinator/index.html" title="mod tracing_subscriber::filter::combinator">combinators</a> for combining <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>.</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.dynamic_filter_fn.html" title="fn tracing_subscriber::filter::dynamic_filter_fn">dynamic_<wbr>filter_<wbr>fn</a></div><div class="desc docblock-short">Constructs a <a href="struct.DynFilterFn.html" title="struct tracing_subscriber::filter::DynFilterFn"><code>DynFilterFn</code></a> from a function or closure that returns <code>true</code>
if a span or event should be enabled within a particular <a href="../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context">span context</a>.</div></li><li><div class="item-name"><a class="fn" href="fn.filter_fn.html" title="fn tracing_subscriber::filter::filter_fn">filter_<wbr>fn</a></div><div class="desc docblock-short">Constructs a <a href="struct.FilterFn.html" title="struct tracing_subscriber::filter::FilterFn"><code>FilterFn</code></a>, from a function or closure that returns <code>true</code> if
a span or event should be enabled, based on its <a href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata"><code>Metadata</code></a>.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/filter/combinator/index.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/filter/combinator/index.html">../../../../tracing_subscriber/filter/combinator/index.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/filter/combinator/index.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/filter/combinator/struct.And.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/filter/combinator/struct.And.html">../../../../tracing_subscriber/filter/combinator/struct.And.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/filter/combinator/struct.And.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/filter/combinator/struct.Not.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/filter/combinator/struct.Not.html">../../../../tracing_subscriber/filter/combinator/struct.Not.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/filter/combinator/struct.Not.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/filter/combinator/struct.Or.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/filter/combinator/struct.Or.html">../../../../tracing_subscriber/filter/combinator/struct.Or.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/filter/combinator/struct.Or.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.FilterId.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.FilterId.html">../../../tracing_subscriber/filter/struct.FilterId.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.FilterId.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.Filtered.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.Filtered.html">../../../tracing_subscriber/filter/struct.Filtered.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.Filtered.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/trait.FilterExt.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/trait.FilterExt.html">../../../tracing_subscriber/filter/trait.FilterExt.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/trait.FilterExt.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.LevelFilter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.LevelFilter.html">../../../tracing_subscriber/filter/struct.LevelFilter.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.LevelFilter.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/filter/struct.LevelParseError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/filter/struct.LevelParseError.html">../../../tracing_subscriber/filter/struct.LevelParseError.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/filter/struct.LevelParseError.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["dynamic_filter_fn","filter_fn"],"mod":["combinator","targets"],"struct":["DynFilterFn","FilterFn","FilterId","Filtered","LevelFilter","LevelParseError","ParseError"],"trait":["FilterExt"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View 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="A filter that enables or disables spans and events based on their target and level."><title>tracing_subscriber::filter::targets - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module targets</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In tracing_<wbr>subscriber::<wbr>filter</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_subscriber</a>::<wbr><a href="../index.html">filter</a></span><h1>Module <span>targets</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_subscriber/filter/targets.rs.html#1-834">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <a href="../../layer/index.html#filtering-with-layers" title="mod tracing_subscriber::layer">filter</a> that enables or disables spans and events based on their <a href="../../../tracing_core/metadata/struct.Metadata.html#method.target" title="method tracing_core::metadata::Metadata::target">target</a> and <a href="../../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level">level</a>.</p>
<p>See <a href="struct.Targets.html" title="struct tracing_subscriber::filter::targets::Targets"><code>Targets</code></a> for details.</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.IntoIter.html" title="struct tracing_subscriber::filter::targets::IntoIter">Into<wbr>Iter</a></div><div class="desc docblock-short">An owning iterator over the <a href="../../../tracing_core/metadata/struct.Metadata.html#method.target" title="method tracing_core::metadata::Metadata::target">target</a>-<a href="../../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level">level</a> pairs of a <code>Targets</code> filter.</div></li><li><div class="item-name"><a class="struct" href="struct.Iter.html" title="struct tracing_subscriber::filter::targets::Iter">Iter</a></div><div class="desc docblock-short">A borrowing iterator over the <a href="../../../tracing_core/metadata/struct.Metadata.html#method.target" title="method tracing_core::metadata::Metadata::target">target</a>-<a href="../../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level">level</a> pairs of a <code>Targets</code> filter.</div></li><li><div class="item-name"><a class="struct" href="struct.Targets.html" title="struct tracing_subscriber::filter::targets::Targets">Targets</a></div><div class="desc docblock-short">A filter that enables or disables spans and events based on their <a href="../../../tracing_core/metadata/struct.Metadata.html#method.target" title="method tracing_core::metadata::Metadata::target">target</a>
and <a href="../../../tracing_core/metadata/struct.Level.html" title="struct tracing_core::metadata::Level">level</a>.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["IntoIter","Iter","Targets"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,219 @@
<!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="Extension trait adding combinators for combining `Filter`."><title>FilterExt in tracing_subscriber::filter - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Filter<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.and" title="and">and</a></li><li><a href="#method.boxed" title="boxed">boxed</a></li><li><a href="#method.not" title="not">not</a></li><li><a href="#method.or" title="or">or</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>filter</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_subscriber</a>::<wbr><a href="index.html">filter</a></span><h1>Trait <span class="trait">FilterExt</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_subscriber/filter/layer_filters/mod.rs.html#183-457">Source</a> </span></div><pre class="rust item-decl"><code>pub trait FilterExt&lt;S&gt;: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt; {
// Provided methods
fn <a href="#method.and" class="fn">and</a>&lt;B&gt;(self, other: B) -&gt; <a class="struct" href="combinator/struct.And.html" title="struct tracing_subscriber::filter::combinator::And">And</a>&lt;Self, B, S&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
B: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.or" class="fn">or</a>&lt;B&gt;(self, other: B) -&gt; <a class="struct" href="combinator/struct.Or.html" title="struct tracing_subscriber::filter::combinator::Or">Or</a>&lt;Self, B, S&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
B: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt;</span> { ... }
<span class="item-spacer"></span> fn <a href="#method.not" class="fn">not</a>(self) -&gt; <a class="struct" href="combinator/struct.Not.html" title="struct tracing_subscriber::filter::combinator::Not">Not</a>&lt;Self, S&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static</span> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait adding <a href="combinator/index.html" title="mod tracing_subscriber::filter::combinator">combinators</a> for combining <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>.</p>
</div></details><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.and" class="method"><a class="src rightside" href="../../src/tracing_subscriber/filter/layer_filters/mod.rs.html#225-231">Source</a><h4 class="code-header">fn <a href="#method.and" class="fn">and</a>&lt;B&gt;(self, other: B) -&gt; <a class="struct" href="combinator/struct.And.html" title="struct tracing_subscriber::filter::combinator::And">And</a>&lt;Self, B, S&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
B: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt;,</div></h4></section></summary><div class="docblock"><p>Combines this <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> with another <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a> s so that spans and
events are enabled if and only if <em>both</em> filters return <code>true</code>.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<p>Enabling spans or events if they have both a particular target <em>and</em> are
above a certain level:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
filter::{filter_fn, LevelFilter, FilterExt},
prelude::<span class="kw-2">*</span>,
};
<span class="comment">// Enables spans and events with targets starting with `interesting_target`:
</span><span class="kw">let </span>target_filter = filter_fn(|meta| {
meta.target().starts_with(<span class="string">"interesting_target"</span>)
});
<span class="comment">// Enables spans and events with levels `INFO` and below:
</span><span class="kw">let </span>level_filter = LevelFilter::INFO;
<span class="comment">// Combine the two filters together, returning a filter that only enables
// spans and events that *both* filters will enable:
</span><span class="kw">let </span>filter = target_filter.and(level_filter);
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(filter))
.init();
<span class="comment">// This event will *not* be enabled:
</span><span class="macro">tracing::info!</span>(<span class="string">"an event with an uninteresting target"</span>);
<span class="comment">// This event *will* be enabled:
</span><span class="macro">tracing::info!</span>(target: <span class="string">"interesting_target"</span>, <span class="string">"a very interesting event"</span>);
<span class="comment">// This event will *not* be enabled:
</span><span class="macro">tracing::debug!</span>(target: <span class="string">"interesting_target"</span>, <span class="string">"interesting debug event..."</span>);</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.or" class="method"><a class="src rightside" href="../../src/tracing_subscriber/filter/layer_filters/mod.rs.html#307-313">Source</a><h4 class="code-header">fn <a href="#method.or" class="fn">or</a>&lt;B&gt;(self, other: B) -&gt; <a class="struct" href="combinator/struct.Or.html" title="struct tracing_subscriber::filter::combinator::Or">Or</a>&lt;Self, B, S&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,
B: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt;,</div></h4></section></summary><div class="docblock"><p>Combines two <a href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter"><code>Filter</code></a>s so that spans and events are enabled if <em>either</em> filter
returns <code>true</code>.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<p>Enabling spans and events at the <code>INFO</code> level and above, and all spans
and events with a particular target:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
filter::{filter_fn, LevelFilter, FilterExt},
prelude::<span class="kw-2">*</span>,
};
<span class="comment">// Enables spans and events with targets starting with `interesting_target`:
</span><span class="kw">let </span>target_filter = filter_fn(|meta| {
meta.target().starts_with(<span class="string">"interesting_target"</span>)
});
<span class="comment">// Enables spans and events with levels `INFO` and below:
</span><span class="kw">let </span>level_filter = LevelFilter::INFO;
<span class="comment">// Combine the two filters together so that a span or event is enabled
// if it is at INFO or lower, or if it has a target starting with
// `interesting_target`.
</span><span class="kw">let </span>filter = level_filter.or(target_filter);
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(filter))
.init();
<span class="comment">// This event will *not* be enabled:
</span><span class="macro">tracing::debug!</span>(<span class="string">"an uninteresting event"</span>);
<span class="comment">// This event *will* be enabled:
</span><span class="macro">tracing::info!</span>(<span class="string">"an uninteresting INFO event"</span>);
<span class="comment">// This event *will* be enabled:
</span><span class="macro">tracing::info!</span>(target: <span class="string">"interesting_target"</span>, <span class="string">"a very interesting event"</span>);
<span class="comment">// This event *will* be enabled:
</span><span class="macro">tracing::debug!</span>(target: <span class="string">"interesting_target"</span>, <span class="string">"interesting debug event..."</span>);</code></pre></div>
<p>Enabling a higher level for a particular target by using <code>or</code> in
conjunction with the <a href="trait.FilterExt.html#method.and" title="method tracing_subscriber::filter::FilterExt::and"><code>and</code></a> combinator:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
filter::{filter_fn, LevelFilter, FilterExt},
prelude::<span class="kw-2">*</span>,
};
<span class="comment">// This filter will enable spans and events with targets beginning with
// `my_crate`:
</span><span class="kw">let </span>my_crate = filter_fn(|meta| {
meta.target().starts_with(<span class="string">"my_crate"</span>)
});
<span class="kw">let </span>filter = my_crate
<span class="comment">// Combine the `my_crate` filter with a `LevelFilter` to produce a
// filter that will enable the `INFO` level and lower for spans and
// events with `my_crate` targets:
</span>.and(LevelFilter::INFO)
<span class="comment">// If a span or event *doesn't* have a target beginning with
// `my_crate`, enable it if it has the `WARN` level or lower:
</span>.or(LevelFilter::WARN);
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(filter))
.init();</code></pre></div>
</div></details><details class="toggle method-toggle" open><summary><section id="method.not" class="method"><a class="src rightside" href="../../src/tracing_subscriber/filter/layer_filters/mod.rs.html#374-379">Source</a><h4 class="code-header">fn <a href="#method.not" class="fn">not</a>(self) -&gt; <a class="struct" href="combinator/struct.Not.html" title="struct tracing_subscriber::filter::combinator::Not">Not</a>&lt;Self, S&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Inverts <code>self</code>, returning a filter that enables spans and events only if
<code>self</code> would <em>not</em> enable them.</p>
<p>This inverts the values returned by the <a href="../layer/trait.Filter.html#tymethod.enabled" title="method tracing_subscriber::layer::Filter::enabled"><code>enabled</code></a> and <a href="../layer/trait.Filter.html#method.callsite_enabled" title="method tracing_subscriber::layer::Filter::callsite_enabled"><code>callsite_enabled</code></a>
methods on the wrapped filter; it does <em>not</em> invert <a href="../layer/trait.Filter.html#method.event_enabled" title="method tracing_subscriber::layer::Filter::event_enabled"><code>event_enabled</code></a>, as
filters which do not implement filtering on event field values will return
the default <code>true</code> even for events that their <a href="../layer/trait.Filter.html#tymethod.enabled" title="method tracing_subscriber::layer::Filter::enabled"><code>enabled</code></a> method disables.</p>
<p>Consider a normal filter defined as:</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">// for spans
</span><span class="kw">match </span>callsite_enabled() {
ALWAYS =&gt; on_span(),
SOMETIMES =&gt; <span class="kw">if </span>enabled() { on_span() },
NEVER =&gt; (),
}
<span class="comment">// for events
</span><span class="kw">match </span>callsite_enabled() {
ALWAYS =&gt; on_event(),
SOMETIMES =&gt; <span class="kw">if </span>enabled() &amp;&amp; event_enabled() { on_event() },
NEVER =&gt; (),
}</code></pre></div>
<p>and an inverted filter defined as:</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">// for spans
</span><span class="kw">match </span>callsite_enabled() {
ALWAYS =&gt; (),
SOMETIMES =&gt; <span class="kw">if </span>!enabled() { on_span() },
NEVER =&gt; on_span(),
}
<span class="comment">// for events
</span><span class="kw">match </span>callsite_enabled() {
ALWAYS =&gt; (),
SOMETIMES =&gt; <span class="kw">if </span>!enabled() { on_event() },
NEVER =&gt; on_event(),
}</code></pre></div>
<p>A proper inversion would do <code>!(enabled() &amp;&amp; event_enabled())</code> (or
<code>!enabled() || !event_enabled()</code>), but because of the implicit <code>&amp;&amp;</code>
relation between <code>enabled</code> and <code>event_enabled</code>, it is difficult to
short circuit and not call the wrapped <code>event_enabled</code>.</p>
<p>A combinator which remembers the result of <code>enabled</code> in order to call
<code>event_enabled</code> only when <code>enabled() == true</code> is possible, but requires
additional thread-local mutable state to support a very niche use case.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.boxed" class="method"><a class="src rightside" href="../../src/tracing_subscriber/filter/layer_filters/mod.rs.html#451-456">Source</a><h4 class="code-header">fn <a href="#method.boxed" class="fn">boxed</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,</div></h4></section></summary><div class="docblock"><p><a href="https://doc.rust-lang.org/1.84.1/alloc/boxed/index.html" title="mod alloc::boxed">Boxes</a> <code>self</code>, erasing its concrete type.</p>
<p>This is equivalent to calling <a href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html#method.new" title="associated function alloc::boxed::Box::new"><code>Box::new</code></a>, but in method form, so that
it can be used when chaining combinator methods.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<p>When different combinations of filters are used conditionally, they may
have different types. For example, the following code wont compile,
since the <code>if</code> and <code>else</code> clause produce filters of different types:</p>
<div class="example-wrap compile_fail"><a href="#" class="tooltip" title="This example deliberately fails to compile"></a><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
filter::{filter_fn, LevelFilter, FilterExt},
prelude::<span class="kw-2">*</span>,
};
<span class="kw">let </span>enable_bar_target: bool = <span class="comment">// ...
</span><span class="kw">let </span>filter = <span class="kw">if </span>enable_bar_target {
filter_fn(|meta| meta.target().starts_with(<span class="string">"foo"</span>))
<span class="comment">// If `enable_bar_target` is true, add a `filter_fn` enabling
// spans and events with the target `bar`:
</span>.or(filter_fn(|meta| meta.target().starts_with(<span class="string">"bar"</span>)))
.and(LevelFilter::INFO)
} <span class="kw">else </span>{
filter_fn(|meta| meta.target().starts_with(<span class="string">"foo"</span>))
.and(LevelFilter::INFO)
};
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(filter))
.init();</code></pre></div>
<p>By using <code>boxed</code>, the types of the two different branches can be erased,
so the assignment to the <code>filter</code> variable is valid (as both branches
have the type <code>Box&lt;dyn Filter&lt;S&gt; + Send + Sync + 'static&gt;</code>). The
following code <em>does</em> compile:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tracing_subscriber::{
filter::{filter_fn, LevelFilter, FilterExt},
prelude::<span class="kw-2">*</span>,
};
<span class="kw">let </span>enable_bar_target: bool = <span class="comment">// ...
</span><span class="kw">let </span>filter = <span class="kw">if </span>enable_bar_target {
filter_fn(|meta| meta.target().starts_with(<span class="string">"foo"</span>))
.or(filter_fn(|meta| meta.target().starts_with(<span class="string">"bar"</span>)))
.and(LevelFilter::INFO)
<span class="comment">// Boxing the filter erases its type, so both branches now
// have the same type.
</span>.boxed()
} <span class="kw">else </span>{
filter_fn(|meta| meta.target().starts_with(<span class="string">"foo"</span>))
.and(LevelFilter::INFO)
.boxed()
};
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_filter(filter))
.init();</code></pre></div>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-FilterExt%3CS%3E-for-F" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/filter/layer_filters/mod.rs.html#1042">Source</a><a href="#impl-FilterExt%3CS%3E-for-F" class="anchor">§</a><h3 class="code-header">impl&lt;F, S&gt; <a class="trait" href="trait.FilterExt.html" title="trait tracing_subscriber::filter::FilterExt">FilterExt</a>&lt;S&gt; for F<div class="where">where
F: <a class="trait" href="../layer/trait.Filter.html" title="trait tracing_subscriber::layer::Filter">Filter</a>&lt;S&gt;,</div></h3></section></div><script src="../../trait.impl/tracing_subscriber/filter/layer_filters/trait.FilterExt.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/fmt/struct.FmtContext.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/fmt/struct.FmtContext.html">../../../tracing_subscriber/fmt/struct.FmtContext.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/fmt/struct.FmtContext.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/fmt/struct.FormattedFields.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/fmt/struct.FormattedFields.html">../../../tracing_subscriber/fmt/struct.FormattedFields.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/fmt/struct.FormattedFields.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../tracing_subscriber/fmt/struct.Layer.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../tracing_subscriber/fmt/struct.Layer.html">../../../tracing_subscriber/fmt/struct.Layer.html</a>...</p>
<script>location.replace("../../../tracing_subscriber/fmt/struct.Layer.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!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="Returns a new `SubscriberBuilder` for configuring a formatting subscriber."><title>fmt in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">fmt</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">fmt</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_subscriber/fmt/mod.rs.html#321-323">Source</a> </span></div><pre class="rust item-decl"><code>pub fn fmt() -&gt; <a class="struct" href="struct.SubscriberBuilder.html" title="struct tracing_subscriber::fmt::SubscriberBuilder">SubscriberBuilder</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="struct.SubscriberBuilder.html" title="struct tracing_subscriber::fmt::SubscriberBuilder"><code>SubscriberBuilder</code></a> for configuring a <a href="struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber">formatting subscriber</a>.</p>
<p>This is essentially shorthand for [<code>SubscriberBuilder::default()]</code>.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Using <a href="struct.SubscriberBuilder.html#method.init" title="method tracing_subscriber::fmt::SubscriberBuilder::init"><code>init</code></a> to set the default subscriber:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt().init();</code></pre></div>
<p>Configuring the output format:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
tracing_subscriber::fmt()
<span class="comment">// Configure formatting settings.
</span>.with_target(<span class="bool-val">false</span>)
.with_timer(tracing_subscriber::fmt::time::uptime())
.with_level(<span class="bool-val">true</span>)
<span class="comment">// Set the subscriber as the default.
</span>.init();</code></pre></div>
<p><a href="struct.SubscriberBuilder.html#method.try_init" title="method tracing_subscriber::fmt::SubscriberBuilder::try_init"><code>try_init</code></a> returns an error if the default subscriber could not be set:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">fn </span>init_subscriber() -&gt; <span class="prelude-ty">Result</span>&lt;(), Box&lt;<span class="kw">dyn </span>Error + Send + Sync + <span class="lifetime">'static</span>&gt;&gt; {
tracing_subscriber::fmt()
<span class="comment">// Configure the subscriber to emit logs in JSON format.
</span>.json()
<span class="comment">// Configure the subscriber to flatten event fields in the output JSON objects.
</span>.flatten_event(<span class="bool-val">true</span>)
<span class="comment">// Set the subscriber as the default, returning an error if this fails.
</span>.try_init()<span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}</code></pre></div>
<p>Rather than setting the subscriber as the default, <a href="struct.SubscriberBuilder.html#method.finish" title="method tracing_subscriber::fmt::SubscriberBuilder::finish"><code>finish</code></a> <em>returns</em> the
constructed subscriber, which may then be passed to other functions:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>subscriber = tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.compact()
.finish();
tracing::subscriber::with_default(subscriber, || {
<span class="comment">// the subscriber will only be set as the default
// inside this closure...
</span>})</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,15 @@
<!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="Returns the default configuration for an [event formatter]."><title>format in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">format</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_subscriber/fmt/format/mod.rs.html#270-272">Source</a> </span></div><pre class="rust item-decl"><code>pub fn format() -&gt; <a class="struct" href="format/struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the default configuration for an [event formatter].</p>
<p>Methods on the returned event formatter can be used for further
configuration. For example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>format = tracing_subscriber::fmt::format()
.without_time() <span class="comment">// Don't include timestamps
</span>.with_target(<span class="bool-val">false</span>) <span class="comment">// Don't include event targets.
</span>.with_level(<span class="bool-val">false</span>) <span class="comment">// Don't include event levels.
</span>.compact(); <span class="comment">// Use a more compact, abbreviated format.
// Use the configured formatter when building a new subscriber.
</span>tracing_subscriber::fmt()
.event_format(format)
.init();</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,15 @@
<!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="Install a global tracing subscriber that listens for events and filters based on the value of the `RUST_LOG` environment variable."><title>init in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">init</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#panics" title="Panics">Panics</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">init</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_subscriber/fmt/mod.rs.html#1243-1245">Source</a> </span></div><pre class="rust item-decl"><code>pub fn init()</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Install a global tracing subscriber that listens for events and
filters based on the value of the <a href="crate::filter::EnvFilter::DEFAULT_ENV"><code>RUST_LOG</code> environment variable</a>.</p>
<p>The configuration of the subscriber initialized by this function
depends on what <a href="../index.html#feature-flags" title="mod tracing_subscriber">feature flags</a> are enabled.</p>
<p>If the <code>tracing-log</code> feature is enabled, this will also install
the LogTracer to convert <code>Log</code> records into <code>tracing</code> <code>Event</code>s.</p>
<p>If the <code>env-filter</code> feature is enabled, this is shorthand for</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.init();</code></pre></div>
<h2 id="panics"><a class="doc-anchor" href="#panics">§</a>Panics</h2>
<p>Panics if the initialization was unsuccessful, likely because a
global subscriber was already installed by another call to <code>try_init</code>.</p>
</div></details></section></div></main></body></html>

View 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="Returns a new formatting layer that can be composed with other layers to construct a `Subscriber`."><title>layer in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">layer</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_subscriber/fmt/mod.rs.html#334-336">Source</a> </span></div><pre class="rust item-decl"><code>pub fn layer&lt;S&gt;() -&gt; <a class="struct" href="struct.Layer.html" title="struct tracing_subscriber::fmt::Layer">Layer</a>&lt;S&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <a href="struct.Layer.html" title="struct tracing_subscriber::fmt::Layer">formatting layer</a> that can be <a href="../layer/index.html" title="mod tracing_subscriber::layer">composed</a> with other layers to
construct a <a href="struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>Subscriber</code></a>.</p>
<p>This is a shorthand for the equivalent <a href="struct.Layer.html#method.default" title="associated function tracing_subscriber::fmt::Layer::default"><code>Layer::default()</code></a> function.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,7 @@
<!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="Returns a new `SystemTime` timestamp provider."><title>time in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">time</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_subscriber/fmt/time/mod.rs.html#67-69">Source</a> </span></div><pre class="rust item-decl"><code>pub fn time() -&gt; <a class="struct" href="time/struct.SystemTime.html" title="struct tracing_subscriber::fmt::time::SystemTime">SystemTime</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <code>SystemTime</code> timestamp provider.</p>
<p>This can then be configured further to determine how timestamps should be
configured.</p>
<p>This is equivalent to calling</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt::time::SystemTime::default()</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,13 @@
<!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="Install a global tracing subscriber that listens for events and filters based on the value of the `RUST_LOG` environment variable, if one is not already set."><title>try_init in tracing_subscriber::fmt - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">try_<wbr>init</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="index.html">fmt</a></span><h1>Function <span class="fn">try_init</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_subscriber/fmt/mod.rs.html#1181-1218">Source</a> </span></div><pre class="rust item-decl"><code>pub fn try_init() -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.84.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;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> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static&gt;&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Install a global tracing subscriber that listens for events and
filters based on the value of the <a href="crate::filter::EnvFilter::DEFAULT_ENV"><code>RUST_LOG</code> environment variable</a>,
if one is not already set.</p>
<p>If the <code>tracing-log</code> feature is enabled, this will also install
the <a href="https://docs.rs/tracing-log/0.1.0/tracing_log/struct.LogTracer.html"><code>LogTracer</code></a> to convert <code>log</code> records into <code>tracing</code> <code>Event</code>s.</p>
<p>This is shorthand for</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt().try_init()</code></pre></div>
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
<p>Returns an Error if the initialization was unsuccessful,
likely because a global subscriber was already installed by another
call to <code>try_init</code>.</p>
</div></details></section></div></main></body></html>

View 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="Returns a `FormatFields` implementation that formats fields using the provided function or closure."><title>debug_fn in tracing_subscriber::fmt::format - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>format</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">format</a></span><h1>Function <span class="fn">debug_fn</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_subscriber/fmt/format/mod.rs.html#284-289">Source</a> </span></div><pre class="rust item-decl"><code>pub fn debug_fn&lt;F&gt;(f: F) -&gt; <a class="struct" href="struct.FieldFn.html" title="struct tracing_subscriber::fmt::format::FieldFn">FieldFn</a>&lt;F&gt;<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'_&gt;, &amp;<a class="struct" href="../../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &amp;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>) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a> + <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation that formats fields using the
provided function or closure.</p>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,15 @@
<!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="Returns the default configuration for an [event formatter]."><title>format in tracing_subscriber::fmt::format - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>format</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">format</a></span><h1>Function <span class="fn">format</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_subscriber/fmt/format/mod.rs.html#270-272">Source</a> </span></div><pre class="rust item-decl"><code>pub fn format() -&gt; <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the default configuration for an [event formatter].</p>
<p>Methods on the returned event formatter can be used for further
configuration. For example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>format = tracing_subscriber::fmt::format()
.without_time() <span class="comment">// Don't include timestamps
</span>.with_target(<span class="bool-val">false</span>) <span class="comment">// Don't include event targets.
</span>.with_level(<span class="bool-val">false</span>) <span class="comment">// Don't include event levels.
</span>.compact(); <span class="comment">// Use a more compact, abbreviated format.
// Use the configured formatter when building a new subscriber.
</span>tracing_subscriber::fmt()
.event_format(format)
.init();</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,37 @@
<!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="Formatters for logging `tracing` events."><title>tracing_subscriber::fmt::format - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module format</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#formatters" title="Formatters">Formatters</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><a href="../index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="../index.html">fmt</a></span><h1>Module <span>format</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_subscriber/fmt/format/mod.rs.html#1-2179">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Formatters for logging <code>tracing</code> events.</p>
<p>This module provides several formatter implementations, as well as utilities
for implementing custom formatters.</p>
<h2 id="formatters"><a class="doc-anchor" href="#formatters">§</a>Formatters</h2>
<p>This module provides a number of formatter implementations:</p>
<ul>
<li>
<p><a href="struct.Full.html" title="struct tracing_subscriber::fmt::format::Full"><code>Full</code></a>: The default formatter. This emits human-readable,
single-line logs for each event that occurs, with the current span context
displayed before the formatted representation of the event. See
<a href="struct.Full.html#example-output" title="struct tracing_subscriber::fmt::format::Full">here</a> for sample output.</p>
</li>
<li>
<p><a href="struct.Compact.html" title="struct tracing_subscriber::fmt::format::Compact"><code>Compact</code></a>: A variant of the default formatter, optimized for
short line lengths. Fields from the current span context are appended to
the fields of the formatted event, and span names are not shown; the
verbosity level is abbreviated to a single character. See
<a href="struct.Compact.html#example-output" title="struct tracing_subscriber::fmt::format::Compact">here</a> for sample output.</p>
</li>
<li>
<p><a href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty"><code>Pretty</code></a>: Emits excessively pretty, multi-line logs, optimized
for human readability. This is primarily intended to be used in local
development and debugging, or for command-line applications, where
automated analysis and compact storage of logs is less of a priority than
readability and visual appeal. See <a href="struct.Pretty.html#example-output" title="struct tracing_subscriber::fmt::format::Pretty">here</a>
for sample output.</p>
</li>
<li>
<p>[<code>Json</code>]: Outputs newline-delimited JSON logs. This is intended
for production use with systems where structured logs are consumed as JSON
by analysis and viewing tools. The JSON output is not optimized for human
readability. See <a href="Json#example-output">here</a> for sample output.</p>
</li>
</ul>
</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.Compact.html" title="struct tracing_subscriber::fmt::format::Compact">Compact</a></div><div class="desc docblock-short">Marker for <a href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format"><code>Format</code></a> that indicates that the compact log format should be used.</div></li><li><div class="item-name"><a class="struct" href="struct.DefaultFields.html" title="struct tracing_subscriber::fmt::format::DefaultFields">Default<wbr>Fields</a></div><div class="desc docblock-short">The default <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation.</div></li><li><div class="item-name"><a class="struct" href="struct.DefaultVisitor.html" title="struct tracing_subscriber::fmt::format::DefaultVisitor">Default<wbr>Visitor</a></div><div class="desc docblock-short">The <a href="../../field/trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a> produced by <a href="struct.DefaultFields.html" title="struct tracing_subscriber::fmt::format::DefaultFields"><code>DefaultFields</code></a>s <a href="../../field/trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><div class="item-name"><a class="struct" href="struct.FieldFn.html" title="struct tracing_subscriber::fmt::format::FieldFn">FieldFn</a></div><div class="desc docblock-short">A <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation that formats fields by calling a function
or closure.</div></li><li><div class="item-name"><a class="struct" href="struct.FieldFnVisitor.html" title="struct tracing_subscriber::fmt::format::FieldFnVisitor">Field<wbr>FnVisitor</a></div><div class="desc docblock-short">The <a href="../../field/trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a> produced by <a href="struct.FieldFn.html" title="struct tracing_subscriber::fmt::format::FieldFn"><code>FieldFn</code></a>s <a href="../../field/trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><div class="item-name"><a class="struct" href="struct.FmtSpan.html" title="struct tracing_subscriber::fmt::format::FmtSpan">FmtSpan</a></div><div class="desc docblock-short">Configures what points in the span lifecycle are logged as events.</div></li><li><div class="item-name"><a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a></div><div class="desc docblock-short">A pre-configured event formatter.</div></li><li><div class="item-name"><a class="struct" href="struct.Full.html" title="struct tracing_subscriber::fmt::format::Full">Full</a></div><div class="desc docblock-short">Marker for <a href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format"><code>Format</code></a> that indicates that the default log format should be used.</div></li><li><div class="item-name"><a class="struct" href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty">Pretty</a></div><div class="desc docblock-short">An excessively pretty, human-readable event formatter.</div></li><li><div class="item-name"><a class="struct" href="struct.PrettyFields.html" title="struct tracing_subscriber::fmt::format::PrettyFields">Pretty<wbr>Fields</a></div><div class="desc docblock-short">An excessively pretty, human-readable <a href="../../field/trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><div class="item-name"><a class="struct" href="struct.PrettyVisitor.html" title="struct tracing_subscriber::fmt::format::PrettyVisitor">Pretty<wbr>Visitor</a></div><div class="desc docblock-short">The <a href="../../field/trait.Visit.html" title="trait tracing_subscriber::field::Visit">visitor</a> produced by <a href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty"><code>Pretty</code></a>s <a href="../../field/trait.MakeVisitor.html" title="trait tracing_subscriber::field::MakeVisitor"><code>MakeVisitor</code></a> implementation.</div></li><li><div class="item-name"><a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a></div><div class="desc docblock-short">A writer to which formatted representations of spans and events are written.</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.FormatEvent.html" title="trait tracing_subscriber::fmt::format::FormatEvent">Format<wbr>Event</a></div><div class="desc docblock-short">A type that can format a tracing <a href="tracing::Event"><code>Event</code></a> to a <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</div></li><li><div class="item-name"><a class="trait" href="trait.FormatFields.html" title="trait tracing_subscriber::fmt::format::FormatFields">Format<wbr>Fields</a></div><div class="desc docblock-short">A type that can format a <a href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">set of fields</a> to a <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</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_fn.html" title="fn tracing_subscriber::fmt::format::debug_fn">debug_<wbr>fn</a></div><div class="desc docblock-short">Returns a <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> implementation that formats fields using the
provided function or closure.</div></li><li><div class="item-name"><a class="fn" href="fn.format.html" title="fn tracing_subscriber::fmt::format::format">format</a></div><div class="desc docblock-short">Returns the default configuration for an [event formatter].</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/fmt/format/struct.Pretty.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/fmt/format/struct.Pretty.html">../../../../tracing_subscriber/fmt/format/struct.Pretty.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/fmt/format/struct.Pretty.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/fmt/format/struct.PrettyFields.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/fmt/format/struct.PrettyFields.html">../../../../tracing_subscriber/fmt/format/struct.PrettyFields.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/fmt/format/struct.PrettyFields.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../../tracing_subscriber/fmt/format/struct.PrettyVisitor.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../../tracing_subscriber/fmt/format/struct.PrettyVisitor.html">../../../../tracing_subscriber/fmt/format/struct.PrettyVisitor.html</a>...</p>
<script>location.replace("../../../../tracing_subscriber/fmt/format/struct.PrettyVisitor.html" + location.search + location.hash);</script>
</body>
</html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["debug_fn","format"],"struct":["Compact","DefaultFields","DefaultVisitor","FieldFn","FieldFnVisitor","FmtSpan","Format","Full","Pretty","PrettyFields","PrettyVisitor","Writer"],"trait":["FormatEvent","FormatFields"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,142 @@
<!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 type that can format a tracing `Event` to a `Writer`."><title>FormatEvent in tracing_subscriber::fmt::format - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Format<wbr>Event</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#arguments" title="Arguments">Arguments</a></li><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.format_event" title="format_event">format_event</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-FormatEvent%3CS,+N%3E-for-fn(%26FmtContext%3C'b,+S,+N%3E,+Writer%3C'c%3E,+%26Event%3C'e%3E)+-%3E+Result%3C(),+Error%3E" title="fn(ctx: &#38;FmtContext&#60;&#39;_, S, N&#62;, _: Writer&#60;&#39;_&#62;, _: &#38;Event&#60;&#39;_&#62;) -&#62; Result">fn(ctx: &#38;FmtContext&#60;&#39;_, S, N&#62;, _: Writer&#60;&#39;_&#62;, _: &#38;Event&#60;&#39;_&#62;) -&#62; Result</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>format</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">format</a></span><h1>Trait <span class="trait">FormatEvent</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_subscriber/fmt/format/mod.rs.html#195-207">Source</a> </span></div><pre class="rust item-decl"><code>pub trait FormatEvent&lt;S, N&gt;<div class="where">where
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'a&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'a&gt;,
N: for&lt;'a&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'a&gt; + 'static,</div>{
// Required method
fn <a href="#tymethod.format_event" class="fn">format_event</a>(
&amp;self,
ctx: &amp;<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a>&lt;'_, S, N&gt;,
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'_&gt;,
event: &amp;<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a>&lt;'_&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A type that can format a tracing <a href="tracing::Event"><code>Event</code></a> to a <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</p>
<p><code>FormatEvent</code> is primarily used in the context of <a href="../struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>fmt::Subscriber</code></a> or
<a href="../struct.Layer.html" title="struct tracing_subscriber::fmt::Layer"><code>fmt::Layer</code></a>. Each time an event is dispatched to <a href="../struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>fmt::Subscriber</code></a> or
<a href="../struct.Layer.html" title="struct tracing_subscriber::fmt::Layer"><code>fmt::Layer</code></a>, the subscriber or layer
forwards it to its associated <code>FormatEvent</code> to emit a log message.</p>
<p>This trait is already implemented for function pointers with the same
signature as <code>format_event</code>.</p>
<h2 id="arguments"><a class="doc-anchor" href="#arguments">§</a>Arguments</h2>
<p>The following arguments are passed to <code>FormatEvent::format_event</code>:</p>
<ul>
<li>
<p>A <a href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext"><code>FmtContext</code></a>. This is an extension of the <a href="../../layer/struct.Context.html" title="struct tracing_subscriber::layer::Context"><code>layer::Context</code></a> type,
which can be used for accessing stored information such as the current
span context an event occurred in.</p>
<p>In addition, <a href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext"><code>FmtContext</code></a> exposes access to the <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a>
implementation that the subscriber was configured to use via the
<a href="../struct.FmtContext.html#method.field_format" title="method tracing_subscriber::fmt::FmtContext::field_format"><code>FmtContext::field_format</code></a> method. This can be used when the
<a href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent"><code>FormatEvent</code></a> implementation needs to format the events fields.</p>
<p>For convenience, <a href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext"><code>FmtContext</code></a> also <a href="../struct.FmtContext.html#impl-FormatFields%3C&#x27;writer%3E" title="struct tracing_subscriber::fmt::FmtContext">implements <code>FormatFields</code></a>,
forwarding to the configured <a href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields"><code>FormatFields</code></a> type.</p>
</li>
<li>
<p>A <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a> to which the formatted representation of the event is
written. This type implements the <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Write.html" title="trait core::fmt::Write"><code>std::fmt::Write</code></a> trait, and therefore
can be used with the <a href="https://doc.rust-lang.org/1.84.1/core/macro.write.html" title="macro core::write"><code>std::write!</code></a> and <a href="https://doc.rust-lang.org/1.84.1/core/macro.writeln.html" title="macro core::writeln"><code>std::writeln!</code></a> macros, as well
as calling <a href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Write.html" title="trait core::fmt::Write"><code>std::fmt::Write</code></a> methods directly.</p>
<p>The <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a> type also implements additional methods that provide
information about how the event should be formatted. The
<a href="struct.Writer.html#method.has_ansi_escapes" title="method tracing_subscriber::fmt::format::Writer::has_ansi_escapes"><code>Writer::has_ansi_escapes</code></a> method indicates whether <a href="https://en.wikipedia.org/wiki/ANSI_escape_code">ANSI terminal
escape codes</a> are supported by the underlying I/O writer that the event
will be written to. If this returns <code>true</code>, the formatter is permitted to
use ANSI escape codes to add colors and other text formatting to its
output. If it returns <code>false</code>, the event will be written to an output that
does not support ANSI escape codes (such as a log file), and they should
not be emitted.</p>
<p>Crates like <a href="https://crates.io/crates/nu_ansi_term"><code>nu_ansi_term</code></a> and <a href="https://crates.io/crates/owo-colors"><code>owo-colors</code></a> can be used to add ANSI
escape codes to formatted output.</p>
</li>
<li>
<p>The actual <a href="tracing::Event"><code>Event</code></a> to be formatted.</p>
</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>This example re-implements a simiplified version of this crates <a href="struct.Full.html" title="struct tracing_subscriber::fmt::format::Full">default
formatter</a>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::fmt;
<span class="kw">use </span>tracing_core::{Subscriber, Event};
<span class="kw">use </span>tracing_subscriber::fmt::{
format::{<span class="self">self</span>, FormatEvent, FormatFields},
FmtContext,
FormattedFields,
};
<span class="kw">use </span>tracing_subscriber::registry::LookupSpan;
<span class="kw">struct </span>MyFormatter;
<span class="kw">impl</span>&lt;S, N&gt; FormatEvent&lt;S, N&gt; <span class="kw">for </span>MyFormatter
<span class="kw">where
</span>S: Subscriber + <span class="kw">for</span>&lt;<span class="lifetime">'a</span>&gt; LookupSpan&lt;<span class="lifetime">'a</span>&gt;,
N: <span class="kw">for</span>&lt;<span class="lifetime">'a</span>&gt; FormatFields&lt;<span class="lifetime">'a</span>&gt; + <span class="lifetime">'static</span>,
{
<span class="kw">fn </span>format_event(
<span class="kw-2">&amp;</span><span class="self">self</span>,
ctx: <span class="kw-2">&amp;</span>FmtContext&lt;<span class="lifetime">'_</span>, S, N&gt;,
<span class="kw-2">mut </span>writer: format::Writer&lt;<span class="lifetime">'_</span>&gt;,
event: <span class="kw-2">&amp;</span>Event&lt;<span class="lifetime">'_</span>&gt;,
) -&gt; fmt::Result {
<span class="comment">// Format values from the event's's metadata:
</span><span class="kw">let </span>metadata = event.metadata();
<span class="macro">write!</span>(<span class="kw-2">&amp;mut </span>writer, <span class="string">"{} {}: "</span>, metadata.level(), metadata.target())<span class="question-mark">?</span>;
<span class="comment">// Format all the spans in the event's span context.
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(scope) = ctx.event_scope() {
<span class="kw">for </span>span <span class="kw">in </span>scope.from_root() {
<span class="macro">write!</span>(writer, <span class="string">"{}"</span>, span.name())<span class="question-mark">?</span>;
<span class="comment">// `FormattedFields` is a formatted representation of the span's
// fields, which is stored in its extensions by the `fmt` layer's
// `new_span` method. The fields will have been formatted
// by the same field formatter that's provided to the event
// formatter in the `FmtContext`.
</span><span class="kw">let </span>ext = span.extensions();
<span class="kw">let </span>fields = <span class="kw-2">&amp;</span>ext
.get::&lt;FormattedFields&lt;N&gt;&gt;()
.expect(<span class="string">"will never be `None`"</span>);
<span class="comment">// Skip formatting the fields if the span had no fields.
</span><span class="kw">if </span>!fields.is_empty() {
<span class="macro">write!</span>(writer, <span class="string">"{{{}}}"</span>, fields)<span class="question-mark">?</span>;
}
<span class="macro">write!</span>(writer, <span class="string">": "</span>)<span class="question-mark">?</span>;
}
}
<span class="comment">// Write fields on the event
</span>ctx.field_format().format_fields(writer.by_ref(), event)<span class="question-mark">?</span>;
<span class="macro">writeln!</span>(writer)
}
}
<span class="kw">let </span>_subscriber = tracing_subscriber::fmt()
.event_format(MyFormatter)
.init();
<span class="kw">let </span>_span = <span class="macro">tracing::info_span!</span>(<span class="string">"my_span"</span>, answer = <span class="number">42</span>).entered();
<span class="macro">tracing::info!</span>(question = <span class="string">"life, the universe, and everything"</span>, <span class="string">"hello world"</span>);</code></pre></div>
<p>This formatter will print events like this:</p>
<div class="example-wrap"><pre class="language-text"><code>DEBUG yak_shaving::shaver: some-span{field-on-span=foo}: started shaving yak</code></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.format_event" class="method"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#201-206">Source</a><h4 class="code-header">fn <a href="#tymethod.format_event" class="fn">format_event</a>(
&amp;self,
ctx: &amp;<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a>&lt;'_, S, N&gt;,
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'_&gt;,
event: &amp;<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a>&lt;'_&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class="docblock"><p>Write a log message for <code>Event</code> in <code>Context</code> to the given <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</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-FormatEvent%3CS,+N%3E-for-fn(%26FmtContext%3C'b,+S,+N%3E,+Writer%3C'c%3E,+%26Event%3C'e%3E)+-%3E+Result%3C(),+Error%3E" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#209-223">Source</a><a href="#impl-FormatEvent%3CS,+N%3E-for-fn(%26FmtContext%3C'b,+S,+N%3E,+Writer%3C'c%3E,+%26Event%3C'e%3E)+-%3E+Result%3C(),+Error%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, N&gt; <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a>&lt;S, N&gt; for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.fn.html">fn</a>(ctx: &amp;<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a>&lt;'_, S, N&gt;, _: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'_&gt;, _: &amp;<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a><div class="where">where
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'a&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'a&gt;,
N: for&lt;'a&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'a&gt; + 'static,</div></h3></section></summary><div class="impl-items"><section id="method.format_event" class="method trait-impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#215-222">Source</a><a href="#method.format_event" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.format_event" class="fn">format_event</a>(
&amp;self,
ctx: &amp;<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a>&lt;'_, S, N&gt;,
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'_&gt;,
event: &amp;<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a>&lt;'_&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</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-FormatEvent%3CC,+N%3E-for-Format%3CPretty,+T%3E" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/pretty.rs.html#169-335">Source</a><a href="#impl-FormatEvent%3CC,+N%3E-for-Format%3CPretty,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;C, N, T&gt; <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a>&lt;C, N&gt; for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a>&lt;<a class="struct" href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty">Pretty</a>, T&gt;<div class="where">where
C: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'a&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'a&gt;,
N: for&lt;'a&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'a&gt; + 'static,
T: <a class="trait" href="../time/trait.FormatTime.html" title="trait tracing_subscriber::fmt::time::FormatTime">FormatTime</a>,</div></h3></section><section id="impl-FormatEvent%3CS,+N%3E-for-Format%3CCompact,+T%3E" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#1026-1156">Source</a><a href="#impl-FormatEvent%3CS,+N%3E-for-Format%3CCompact,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, N, T&gt; <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a>&lt;S, N&gt; for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a>&lt;<a class="struct" href="struct.Compact.html" title="struct tracing_subscriber::fmt::format::Compact">Compact</a>, T&gt;<div class="where">where
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'a&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'a&gt;,
N: for&lt;'a&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'a&gt; + 'static,
T: <a class="trait" href="../time/trait.FormatTime.html" title="trait tracing_subscriber::fmt::time::FormatTime">FormatTime</a>,</div></h3></section><section id="impl-FormatEvent%3CS,+N%3E-for-Format%3CFull,+T%3E" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#898-1024">Source</a><a href="#impl-FormatEvent%3CS,+N%3E-for-Format%3CFull,+T%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, N, T&gt; <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a>&lt;S, N&gt; for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a>&lt;<a class="struct" href="struct.Full.html" title="struct tracing_subscriber::fmt::format::Full">Full</a>, T&gt;<div class="where">where
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'a&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'a&gt;,
N: for&lt;'a&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'a&gt; + 'static,
T: <a class="trait" href="../time/trait.FormatTime.html" title="trait tracing_subscriber::fmt::time::FormatTime">FormatTime</a>,</div></h3></section></div><script src="../../../trait.impl/tracing_subscriber/fmt/format/trait.FormatEvent.js" data-ignore-extern-crates="std" async></script></section></div></main></body></html>

View file

@ -0,0 +1,36 @@
<!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 type that can format a set of fields to a `Writer`."><title>FormatFields in tracing_subscriber::fmt::format - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Format<wbr>Fields</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.format_fields" title="format_fields">format_fields</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.add_fields" title="add_fields">add_fields</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>format</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">format</a></span><h1>Trait <span class="trait">FormatFields</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_subscriber/fmt/format/mod.rs.html#232-251">Source</a> </span></div><pre class="rust item-decl"><code>pub trait FormatFields&lt;'writer&gt; {
// Required method
fn <a href="#tymethod.format_fields" class="fn">format_fields</a>&lt;R: <a class="trait" href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>&gt;(
&amp;self,
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'writer&gt;,
fields: R,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>;
// Provided method
fn <a href="#method.add_fields" class="fn">add_fields</a>(
&amp;self,
current: &amp;'writer mut <a class="struct" href="../struct.FormattedFields.html" title="struct tracing_subscriber::fmt::FormattedFields">FormattedFields</a>&lt;Self&gt;,
fields: &amp;<a class="struct" href="../../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record">Record</a>&lt;'_&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A type that can format a <a href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">set of fields</a> to a <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>.</p>
<p><code>FormatFields</code> is primarily used in the context of <a href="../struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>FmtSubscriber</code></a>. Each
time a span or event with fields is recorded, the subscriber will format
those fields with its associated <code>FormatFields</code> implementation.</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.format_fields" class="method"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#234">Source</a><h4 class="code-header">fn <a href="#tymethod.format_fields" class="fn">format_fields</a>&lt;R: <a class="trait" href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>&gt;(
&amp;self,
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'writer&gt;,
fields: R,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class="docblock"><p>Format the provided <code>fields</code> to the provided <a href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer"><code>Writer</code></a>, returning a result.</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.add_fields" class="method"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#241-250">Source</a><h4 class="code-header">fn <a href="#method.add_fields" class="fn">add_fields</a>(
&amp;self,
current: &amp;'writer mut <a class="struct" href="../struct.FormattedFields.html" title="struct tracing_subscriber::fmt::FormattedFields">FormattedFields</a>&lt;Self&gt;,
fields: &amp;<a class="struct" href="../../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record">Record</a>&lt;'_&gt;,
) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class="docblock"><p>Record additional field(s) on an existing span.</p>
<p>By default, this appends a space to the current set of fields if it is
non-empty, and then calls <code>self.format_fields</code>. If different behavior is
required, the default implementation of this method can be overridden.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.1/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-FormatFields%3C'writer%3E-for-Pretty" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/pretty.rs.html#337-355">Source</a><a href="#impl-FormatFields%3C'writer%3E-for-Pretty" class="anchor">§</a><h3 class="code-header">impl&lt;'writer&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'writer&gt; for <a class="struct" href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty">Pretty</a></h3></section><section id="impl-FormatFields%3C'writer%3E-for-M" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/format/mod.rs.html#1159-1169">Source</a><a href="#impl-FormatFields%3C'writer%3E-for-M" class="anchor">§</a><h3 class="code-header">impl&lt;'writer, M&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'writer&gt; for M<div class="where">where
M: <a class="trait" href="../../field/trait.MakeOutput.html" title="trait tracing_subscriber::field::MakeOutput">MakeOutput</a>&lt;<a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a>&lt;'writer&gt;, <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>&gt;,
M::<a class="associatedtype" href="../../field/trait.MakeVisitor.html#associatedtype.Visitor" title="type tracing_subscriber::field::MakeVisitor::Visitor">Visitor</a>: <a class="trait" href="../../field/trait.VisitFmt.html" title="trait tracing_subscriber::field::VisitFmt">VisitFmt</a> + <a class="trait" href="../../field/trait.VisitOutput.html" title="trait tracing_subscriber::field::VisitOutput">VisitOutput</a>&lt;<a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>&gt;,</div></h3></section><section id="impl-FormatFields%3C'writer%3E-for-FmtContext%3C'_,+S,+N%3E" class="impl"><a class="src rightside" href="../../../src/tracing_subscriber/fmt/fmt_layer.rs.html#1044-1056">Source</a><a href="#impl-FormatFields%3C'writer%3E-for-FmtContext%3C'_,+S,+N%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'writer, S, N&gt; <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'writer&gt; for <a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a>&lt;'_, S, N&gt;<div class="where">where
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for&lt;'lookup&gt; <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a>&lt;'lookup&gt;,
N: <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a>&lt;'writer&gt; + 'static,</div></h3></section></div><script src="../../../trait.impl/tracing_subscriber/fmt/format/trait.FormatFields.js" async></script></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["fmt","format","init","layer","time","try_init"],"mod":["format","time","writer"],"struct":["FmtContext","FormattedFields","Layer","Subscriber","SubscriberBuilder","TestWriter"],"trait":["FormatEvent","FormatFields","MakeWriter"],"type":["Formatter"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
<!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="Returns a new `SystemTime` timestamp provider."><title>time in tracing_subscriber::fmt::time - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>time</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">time</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_subscriber/fmt/time/mod.rs.html#67-69">Source</a> </span></div><pre class="rust item-decl"><code>pub fn time() -&gt; <a class="struct" href="struct.SystemTime.html" title="struct tracing_subscriber::fmt::time::SystemTime">SystemTime</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <code>SystemTime</code> timestamp provider.</p>
<p>This can then be configured further to determine how timestamps should be
configured.</p>
<p>This is equivalent to calling</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt::time::SystemTime::default()</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,9 @@
<!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="Returns a new `Uptime` timestamp provider."><title>uptime in tracing_subscriber::fmt::time - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In tracing_<wbr>subscriber::<wbr>fmt::<wbr>time</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_subscriber</a>::<wbr><a href="../index.html">fmt</a>::<wbr><a href="index.html">time</a></span><h1>Function <span class="fn">uptime</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_subscriber/fmt/time/mod.rs.html#85-87">Source</a> </span></div><pre class="rust item-decl"><code>pub fn uptime() -&gt; <a class="struct" href="struct.Uptime.html" title="struct tracing_subscriber::fmt::time::Uptime">Uptime</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a new <code>Uptime</code> timestamp provider.</p>
<p>With this timer, timestamps will be formatted with the amount of time
elapsed since the timestamp provider was constructed.</p>
<p>This can then be configured further to determine how timestamps should be
configured.</p>
<p>This is equivalent to calling</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>tracing_subscriber::fmt::time::Uptime::default()</code></pre></div>
</div></details></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!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="Formatters for event timestamps."><title>tracing_subscriber::fmt::time - 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_subscriber" 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_subscriber/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_subscriber/index.html"><img src="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png" alt="logo"></a><h2><a href="../../../tracing_subscriber/index.html">tracing_<wbr>subscriber</a><span class="version">0.3.19</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module time</a></h2><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><a href="../index.html">In tracing_<wbr>subscriber::<wbr>fmt</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_subscriber</a>::<wbr><a href="../index.html">fmt</a></span><h1>Module <span>time</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_subscriber/fmt/time/mod.rs.html#1-151">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Formatters for event timestamps.</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.SystemTime.html" title="struct tracing_subscriber::fmt::time::SystemTime">System<wbr>Time</a></div><div class="desc docblock-short">Retrieve and print the current wall-clock time.</div></li><li><div class="item-name"><a class="struct" href="struct.Uptime.html" title="struct tracing_subscriber::fmt::time::Uptime">Uptime</a></div><div class="desc docblock-short">Retrieve and print the relative elapsed wall-clock time since an epoch.</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.FormatTime.html" title="trait tracing_subscriber::fmt::time::FormatTime">Format<wbr>Time</a></div><div class="desc docblock-short">A type that can measure and format the current time.</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.time.html" title="fn tracing_subscriber::fmt::time::time">time</a></div><div class="desc docblock-short">Returns a new <code>SystemTime</code> timestamp provider.</div></li><li><div class="item-name"><a class="fn" href="fn.uptime.html" title="fn tracing_subscriber::fmt::time::uptime">uptime</a></div><div class="desc docblock-short">Returns a new <code>Uptime</code> timestamp provider.</div></li></ul></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["time","uptime"],"struct":["SystemTime","Uptime"],"trait":["FormatTime"]};

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more