mirror of
https://github.com/NotAShelf/mpvrc.git
synced 2026-04-18 00:38:14 +00:00
deploy: de38ae62916547ad097c066f94a32e9ba7790eeb
This commit is contained in:
commit
9a86359447
28502 changed files with 1261284 additions and 0 deletions
4
tracing_subscriber/fmt/format/fn.debug_fn.html
Normal file
4
tracing_subscriber/fmt/format/fn.debug_fn.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="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<F>(f: F) -> <a class="struct" href="struct.FieldFn.html" title="struct tracing_subscriber::fmt::format::FieldFn">FieldFn</a><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>(&mut <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_>, &<a class="struct" href="../../../tracing_core/field/struct.Field.html" title="struct tracing_core::field::Field">Field</a>, &dyn <a class="trait" href="https://doc.rust-lang.org/1.84.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>) -> <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>
|
||||
15
tracing_subscriber/fmt/format/fn.format.html
Normal file
15
tracing_subscriber/fmt/format/fn.format.html
Normal 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() -> <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>
|
||||
37
tracing_subscriber/fmt/format/index.html
Normal file
37
tracing_subscriber/fmt/format/index.html
Normal 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>
|
||||
11
tracing_subscriber/fmt/format/pretty/struct.Pretty.html
Normal file
11
tracing_subscriber/fmt/format/pretty/struct.Pretty.html
Normal 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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
1
tracing_subscriber/fmt/format/sidebar-items.js
Normal file
1
tracing_subscriber/fmt/format/sidebar-items.js
Normal 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"]};
|
||||
40
tracing_subscriber/fmt/format/struct.Compact.html
Normal file
40
tracing_subscriber/fmt/format/struct.Compact.html
Normal file
File diff suppressed because one or more lines are too long
19
tracing_subscriber/fmt/format/struct.DefaultFields.html
Normal file
19
tracing_subscriber/fmt/format/struct.DefaultFields.html
Normal file
File diff suppressed because one or more lines are too long
22
tracing_subscriber/fmt/format/struct.DefaultVisitor.html
Normal file
22
tracing_subscriber/fmt/format/struct.DefaultVisitor.html
Normal file
File diff suppressed because one or more lines are too long
28
tracing_subscriber/fmt/format/struct.FieldFn.html
Normal file
28
tracing_subscriber/fmt/format/struct.FieldFn.html
Normal file
File diff suppressed because one or more lines are too long
20
tracing_subscriber/fmt/format/struct.FieldFnVisitor.html
Normal file
20
tracing_subscriber/fmt/format/struct.FieldFnVisitor.html
Normal file
File diff suppressed because one or more lines are too long
29
tracing_subscriber/fmt/format/struct.FmtSpan.html
Normal file
29
tracing_subscriber/fmt/format/struct.FmtSpan.html
Normal file
File diff suppressed because one or more lines are too long
96
tracing_subscriber/fmt/format/struct.Format.html
Normal file
96
tracing_subscriber/fmt/format/struct.Format.html
Normal file
File diff suppressed because one or more lines are too long
36
tracing_subscriber/fmt/format/struct.Full.html
Normal file
36
tracing_subscriber/fmt/format/struct.Full.html
Normal file
File diff suppressed because one or more lines are too long
98
tracing_subscriber/fmt/format/struct.Pretty.html
Normal file
98
tracing_subscriber/fmt/format/struct.Pretty.html
Normal file
File diff suppressed because one or more lines are too long
20
tracing_subscriber/fmt/format/struct.PrettyFields.html
Normal file
20
tracing_subscriber/fmt/format/struct.PrettyFields.html
Normal file
File diff suppressed because one or more lines are too long
22
tracing_subscriber/fmt/format/struct.PrettyVisitor.html
Normal file
22
tracing_subscriber/fmt/format/struct.PrettyVisitor.html
Normal file
File diff suppressed because one or more lines are too long
67
tracing_subscriber/fmt/format/struct.Writer.html
Normal file
67
tracing_subscriber/fmt/format/struct.Writer.html
Normal file
File diff suppressed because one or more lines are too long
142
tracing_subscriber/fmt/format/trait.FormatEvent.html
Normal file
142
tracing_subscriber/fmt/format/trait.FormatEvent.html
Normal 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: &FmtContext<'_, S, N>, _: Writer<'_>, _: &Event<'_>) -> Result">fn(ctx: &FmtContext<'_, S, N>, _: Writer<'_>, _: &Event<'_>) -> 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<S, N><div class="where">where
|
||||
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for<'a> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'a>,
|
||||
N: for<'a> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'a> + 'static,</div>{
|
||||
// Required method
|
||||
fn <a href="#tymethod.format_event" class="fn">format_event</a>(
|
||||
&self,
|
||||
ctx: &<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a><'_, S, N>,
|
||||
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_>,
|
||||
event: &<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a><'_>,
|
||||
) -> <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 event’s 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'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 crate’s <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><S, N> FormatEvent<S, N> <span class="kw">for </span>MyFormatter
|
||||
<span class="kw">where
|
||||
</span>S: Subscriber + <span class="kw">for</span><<span class="lifetime">'a</span>> LookupSpan<<span class="lifetime">'a</span>>,
|
||||
N: <span class="kw">for</span><<span class="lifetime">'a</span>> FormatFields<<span class="lifetime">'a</span>> + <span class="lifetime">'static</span>,
|
||||
{
|
||||
<span class="kw">fn </span>format_event(
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
ctx: <span class="kw-2">&</span>FmtContext<<span class="lifetime">'_</span>, S, N>,
|
||||
<span class="kw-2">mut </span>writer: format::Writer<<span class="lifetime">'_</span>>,
|
||||
event: <span class="kw-2">&</span>Event<<span class="lifetime">'_</span>>,
|
||||
) -> 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">&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">&</span>ext
|
||||
.get::<FormattedFields<N>>()
|
||||
.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>(
|
||||
&self,
|
||||
ctx: &<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a><'_, S, N>,
|
||||
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_>,
|
||||
event: &<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a><'_>,
|
||||
) -> <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<S, N> <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a><S, N> for <a class="primitive" href="https://doc.rust-lang.org/1.84.1/std/primitive.fn.html">fn</a>(ctx: &<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a><'_, S, N>, _: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_>, _: &<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a><'_>) -> <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<'a> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'a>,
|
||||
N: for<'a> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'a> + '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>(
|
||||
&self,
|
||||
ctx: &<a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a><'_, S, N>,
|
||||
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_>,
|
||||
event: &<a class="struct" href="../../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event">Event</a><'_>,
|
||||
) -> <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<C, N, T> <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a><C, N> for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a><<a class="struct" href="struct.Pretty.html" title="struct tracing_subscriber::fmt::format::Pretty">Pretty</a>, T><div class="where">where
|
||||
C: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for<'a> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'a>,
|
||||
N: for<'a> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'a> + '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<S, N, T> <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a><S, N> for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a><<a class="struct" href="struct.Compact.html" title="struct tracing_subscriber::fmt::format::Compact">Compact</a>, T><div class="where">where
|
||||
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for<'a> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'a>,
|
||||
N: for<'a> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'a> + '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<S, N, T> <a class="trait" href="../trait.FormatEvent.html" title="trait tracing_subscriber::fmt::FormatEvent">FormatEvent</a><S, N> for <a class="struct" href="struct.Format.html" title="struct tracing_subscriber::fmt::format::Format">Format</a><<a class="struct" href="struct.Full.html" title="struct tracing_subscriber::fmt::format::Full">Full</a>, T><div class="where">where
|
||||
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for<'a> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'a>,
|
||||
N: for<'a> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'a> + '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>
|
||||
36
tracing_subscriber/fmt/format/trait.FormatFields.html
Normal file
36
tracing_subscriber/fmt/format/trait.FormatFields.html
Normal 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<'writer> {
|
||||
// Required method
|
||||
fn <a href="#tymethod.format_fields" class="fn">format_fields</a><R: <a class="trait" href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>>(
|
||||
&self,
|
||||
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'writer>,
|
||||
fields: R,
|
||||
) -> <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>(
|
||||
&self,
|
||||
current: &'writer mut <a class="struct" href="../struct.FormattedFields.html" title="struct tracing_subscriber::fmt::FormattedFields">FormattedFields</a><Self>,
|
||||
fields: &<a class="struct" href="../../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record">Record</a><'_>,
|
||||
) -> <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><R: <a class="trait" href="../../field/trait.RecordFields.html" title="trait tracing_subscriber::field::RecordFields">RecordFields</a>>(
|
||||
&self,
|
||||
writer: <a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'writer>,
|
||||
fields: R,
|
||||
) -> <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>(
|
||||
&self,
|
||||
current: &'writer mut <a class="struct" href="../struct.FormattedFields.html" title="struct tracing_subscriber::fmt::FormattedFields">FormattedFields</a><Self>,
|
||||
fields: &<a class="struct" href="../../../tracing_core/span/struct.Record.html" title="struct tracing_core::span::Record">Record</a><'_>,
|
||||
) -> <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<'writer> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'writer> 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<'writer, M> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'writer> for M<div class="where">where
|
||||
M: <a class="trait" href="../../field/trait.MakeOutput.html" title="trait tracing_subscriber::field::MakeOutput">MakeOutput</a><<a class="struct" href="struct.Writer.html" title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'writer>, <a class="type" href="https://doc.rust-lang.org/1.84.1/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>>,
|
||||
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><<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-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<'writer, S, N> <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'writer> for <a class="struct" href="../struct.FmtContext.html" title="struct tracing_subscriber::fmt::FmtContext">FmtContext</a><'_, S, N><div class="where">where
|
||||
S: <a class="trait" href="../../../tracing_core/subscriber/trait.Subscriber.html" title="trait tracing_core::subscriber::Subscriber">Subscriber</a> + for<'lookup> <a class="trait" href="../../registry/trait.LookupSpan.html" title="trait tracing_subscriber::registry::LookupSpan">LookupSpan</a><'lookup>,
|
||||
N: <a class="trait" href="../trait.FormatFields.html" title="trait tracing_subscriber::fmt::FormatFields">FormatFields</a><'writer> + 'static,</div></h3></section></div><script src="../../../trait.impl/tracing_subscriber/fmt/format/trait.FormatFields.js" async></script></section></div></main></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue