mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-24 00:48:24 +00:00
148 lines
35 KiB
HTML
148 lines
35 KiB
HTML
<!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 create `io::Write` instances."><title>MakeWriter in tracing_subscriber::fmt - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tracing_subscriber" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</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_subscriber</a><span class="version">0.3.18</span></h2></div><h2 class="location"><a href="#">MakeWriter</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Writer">Writer</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.make_writer">make_writer</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.make_writer_for">make_writer_for</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-MakeWriter%3C'a%3E-for-Arc%3CW%3E">Arc<W></a></li><li><a href="#impl-MakeWriter%3C'a%3E-for-File">File</a></li><li><a href="#impl-MakeWriter%3C'a%3E-for-Mutex%3CW%3E">Mutex<W></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In tracing_subscriber::fmt</a></h2></div></nav><div class="sidebar-resizer"></div>
|
||
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../tracing_subscriber/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">tracing_subscriber</a>::<wbr><a href="index.html">fmt</a>::<wbr><a class="trait" href="#">MakeWriter</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/tracing_subscriber/fmt/writer.rs.html#95-209">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait MakeWriter<'a> {
|
||
type <a href="#associatedtype.Writer" class="associatedtype">Writer</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a>;
|
||
|
||
// Required method
|
||
fn <a href="#tymethod.make_writer" class="fn">make_writer</a>(&'a self) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>;
|
||
|
||
// Provided method
|
||
fn <a href="#method.make_writer_for" class="fn">make_writer_for</a>(&'a self, meta: &<a class="struct" href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata">Metadata</a><'_>) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</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 create <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a> instances.</p>
|
||
<p><code>MakeWriter</code> is used by <a href="struct.Layer.html" title="struct tracing_subscriber::fmt::Layer"><code>fmt::Layer</code></a> or <a href="struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>fmt::Subscriber</code></a> to print
|
||
formatted text representations of <a href="../../tracing_core/event/struct.Event.html" title="struct tracing_core::event::Event"><code>Event</code></a>s.</p>
|
||
<p>This trait is already implemented for function pointers and
|
||
immutably-borrowing closures that return an instance of <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a>, such
|
||
as <a href="https://doc.rust-lang.org/1.76.0/std/io/stdio/fn.stdout.html" title="fn std::io::stdio::stdout"><code>io::stdout</code></a> and <a href="https://doc.rust-lang.org/1.76.0/std/io/stdio/fn.stderr.html" title="fn std::io::stdio::stderr"><code>io::stderr</code></a>. Additionally, it is implemented for
|
||
<a href="https://doc.rust-lang.org/1.76.0/std/sync/mutex/struct.Mutex.html" title="struct std::sync::mutex::Mutex"><code>std::sync::Mutex</code></a> when the type inside the mutex implements
|
||
<a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a>.</p>
|
||
<h2 id="examples"><a href="#examples">Examples</a></h2>
|
||
<p>The simplest usage is to pass in a named function that returns a writer. For
|
||
example, to log all events to stderr, we could write:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>subscriber = tracing_subscriber::fmt()
|
||
.with_writer(std::io::stderr)
|
||
.finish();</code></pre></div>
|
||
<p>Any function that returns a writer can be used:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>make_my_great_writer() -> <span class="kw">impl </span>std::io::Write {
|
||
<span class="comment">// ...
|
||
</span>}
|
||
|
||
<span class="kw">let </span>subscriber = tracing_subscriber::fmt()
|
||
.with_writer(make_my_great_writer)
|
||
.finish();</code></pre></div>
|
||
<p>A closure can be used to introduce arbitrary logic into how the writer is
|
||
created. Consider the (admittedly rather silly) example of sending every 5th
|
||
event to stderr, and all other events to stdout:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io;
|
||
<span class="kw">use </span>std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
|
||
|
||
<span class="kw">let </span>n = AtomicUsize::new(<span class="number">0</span>);
|
||
<span class="kw">let </span>subscriber = tracing_subscriber::fmt()
|
||
.with_writer(<span class="kw">move </span>|| -> Box<<span class="kw">dyn </span>io::Write> {
|
||
<span class="kw">if </span>n.fetch_add(<span class="number">1</span>, Relaxed) % <span class="number">5 </span>== <span class="number">0 </span>{
|
||
Box::new(io::stderr())
|
||
} <span class="kw">else </span>{
|
||
Box::new(io::stdout())
|
||
}
|
||
})
|
||
.finish();</code></pre></div>
|
||
<p>A single instance of a type implementing <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a> may be used as a
|
||
<code>MakeWriter</code> by wrapping it in a <a href="https://doc.rust-lang.org/1.76.0/std/sync/mutex/struct.Mutex.html" title="struct std::sync::mutex::Mutex"><code>Mutex</code></a>. For example, we could
|
||
write to a file like so:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::{fs::File, sync::Mutex};
|
||
|
||
<span class="kw">let </span>log_file = File::create(<span class="string">"my_cool_trace.log"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>subscriber = tracing_subscriber::fmt()
|
||
.with_writer(Mutex::new(log_file))
|
||
.finish();</code></pre></div>
|
||
</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.Writer" class="method"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#100">source</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a></h4></section></summary><div class="docblock"><p>The concrete <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a> implementation returned by <a href="trait.MakeWriter.html#tymethod.make_writer" title="method tracing_subscriber::fmt::MakeWriter::make_writer"><code>make_writer</code></a>.</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_writer" class="method"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#115">source</a><h4 class="code-header">fn <a href="#tymethod.make_writer" class="fn">make_writer</a>(&'a self) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a></h4></section></summary><div class="docblock"><p>Returns an instance of <a href="trait.MakeWriter.html#associatedtype.Writer" title="associated type tracing_subscriber::fmt::MakeWriter::Writer"><code>Writer</code></a>.</p>
|
||
<h5 id="implementer-notes"><a href="#implementer-notes">Implementer notes</a></h5>
|
||
<p><a href="struct.Layer.html" title="struct tracing_subscriber::fmt::Layer"><code>fmt::Layer</code></a> or <a href="struct.Subscriber.html" title="struct tracing_subscriber::fmt::Subscriber"><code>fmt::Subscriber</code></a> will call this method each time an event is recorded. Ensure any state
|
||
that must be saved across writes is not lost when the <a href="trait.MakeWriter.html#associatedtype.Writer" title="associated type tracing_subscriber::fmt::MakeWriter::Writer"><code>Writer</code></a> instance is dropped. If
|
||
creating a <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>io::Write</code></a> instance is expensive, be sure to cache it when implementing
|
||
<a href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter"><code>MakeWriter</code></a> to improve performance.</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.make_writer_for" class="method"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#205-208">source</a><h4 class="code-header">fn <a href="#method.make_writer_for" class="fn">make_writer_for</a>(&'a self, meta: &<a class="struct" href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata">Metadata</a><'_>) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a></h4></section></summary><div class="docblock"><p>Returns a <a href="trait.MakeWriter.html#associatedtype.Writer" title="associated type tracing_subscriber::fmt::MakeWriter::Writer"><code>Writer</code></a> for writing data from the span or event described
|
||
by the provided <a href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata"><code>Metadata</code></a>.</p>
|
||
<p>By default, this calls <a href="trait.MakeWriter.html#tymethod.make_writer" title="method tracing_subscriber::fmt::MakeWriter::make_writer"><code>self.make_writer()</code></a>, ignoring
|
||
the provided metadata, but implementations can override this to provide
|
||
metadata-specific behaviors.</p>
|
||
<p>This method allows <code>MakeWriter</code> implementations to implement different
|
||
behaviors based on the span or event being written. The <code>MakeWriter</code>
|
||
type might return different writers based on the provided metadata, or
|
||
might write some values to the writer before or after providing it to
|
||
the caller.</p>
|
||
<p>For example, we might want to write data from spans and events at the
|
||
<a href="../../tracing_core/metadata/struct.Level.html#associatedconstant.ERROR" title="associated constant tracing_core::metadata::Level::ERROR"><code>ERROR</code></a> and <a href="../../tracing_core/metadata/struct.Level.html#associatedconstant.WARN" title="associated constant tracing_core::metadata::Level::WARN"><code>WARN</code></a> levels to <code>stderr</code>, and data from spans or events
|
||
at lower levels to stdout:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io::{<span class="self">self</span>, Stdout, Stderr, StdoutLock, StderrLock};
|
||
<span class="kw">use </span>tracing_subscriber::fmt::writer::MakeWriter;
|
||
<span class="kw">use </span>tracing_core::{Metadata, Level};
|
||
|
||
<span class="kw">pub struct </span>MyMakeWriter {
|
||
stdout: Stdout,
|
||
stderr: Stderr,
|
||
}
|
||
|
||
<span class="doccomment">/// A lock on either stdout or stderr, depending on the verbosity level
|
||
/// of the event being written.
|
||
</span><span class="kw">pub enum </span>StdioLock<<span class="lifetime">'a</span>> {
|
||
Stdout(StdoutLock<<span class="lifetime">'a</span>>),
|
||
Stderr(StderrLock<<span class="lifetime">'a</span>>),
|
||
}
|
||
|
||
<span class="kw">impl</span><<span class="lifetime">'a</span>> io::Write <span class="kw">for </span>StdioLock<<span class="lifetime">'a</span>> {
|
||
<span class="kw">fn </span>write(<span class="kw-2">&mut </span><span class="self">self</span>, buf: <span class="kw-2">&</span>[u8]) -> io::Result<usize> {
|
||
<span class="kw">match </span><span class="self">self </span>{
|
||
StdioLock::Stdout(lock) => lock.write(buf),
|
||
StdioLock::Stderr(lock) => lock.write(buf),
|
||
}
|
||
}
|
||
|
||
<span class="kw">fn </span>write_all(<span class="kw-2">&mut </span><span class="self">self</span>, buf: <span class="kw-2">&</span>[u8]) -> io::Result<()> {
|
||
<span class="comment">// ...
|
||
</span>}
|
||
|
||
<span class="kw">fn </span>flush(<span class="kw-2">&mut </span><span class="self">self</span>) -> io::Result<()> {
|
||
<span class="comment">// ...
|
||
</span>}
|
||
}
|
||
|
||
<span class="kw">impl</span><<span class="lifetime">'a</span>> MakeWriter<<span class="lifetime">'a</span>> <span class="kw">for </span>MyMakeWriter {
|
||
<span class="kw">type </span>Writer = StdioLock<<span class="lifetime">'a</span>>;
|
||
|
||
<span class="kw">fn </span>make_writer(<span class="kw-2">&</span><span class="lifetime">'a </span><span class="self">self</span>) -> <span class="self">Self</span>::Writer {
|
||
<span class="comment">// We must have an implementation of `make_writer` that makes
|
||
// a "default" writer without any configuring metadata. Let's
|
||
// just return stdout in that case.
|
||
</span>StdioLock::Stdout(<span class="self">self</span>.stdout.lock())
|
||
}
|
||
|
||
<span class="kw">fn </span>make_writer_for(<span class="kw-2">&</span><span class="lifetime">'a </span><span class="self">self</span>, meta: <span class="kw-2">&</span>Metadata<<span class="lifetime">'_</span>>) -> <span class="self">Self</span>::Writer {
|
||
<span class="comment">// Here's where we can implement our special behavior. We'll
|
||
// check if the metadata's verbosity level is WARN or ERROR,
|
||
// and return stderr in that case.
|
||
</span><span class="kw">if </span>meta.level() <= <span class="kw-2">&</span>Level::WARN {
|
||
<span class="kw">return </span>StdioLock::Stderr(<span class="self">self</span>.stderr.lock());
|
||
}
|
||
|
||
<span class="comment">// Otherwise, we'll return stdout.
|
||
</span>StdioLock::Stdout(<span class="self">self</span>.stdout.lock())
|
||
}
|
||
}</code></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-MakeWriter%3C'a%3E-for-File" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#694-699">source</a><a href="#impl-MakeWriter%3C'a%3E-for-File" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/fs/struct.File.html" title="struct std::fs::File">File</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-1" class="associatedtype trait-impl"><a href="#associatedtype.Writer-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = &'a <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/fs/struct.File.html" title="struct std::fs::File">File</a></h4></section><section id="method.make_writer" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#696-698">source</a><a href="#method.make_writer" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.make_writer" class="fn">make_writer</a>(&'a self) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-Arc%3CW%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#684-692">source</a><a href="#impl-MakeWriter%3C'a%3E-for-Arc%3CW%3E" class="anchor">§</a><h3 class="code-header">impl<'a, W> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><W><div class="where">where
|
||
<a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&'a W</a>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + 'a,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-2" class="associatedtype trait-impl"><a href="#associatedtype.Writer-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&'a W</a></h4></section><section id="method.make_writer-1" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#689-691">source</a><a href="#method.make_writer-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.make_writer" class="fn">make_writer</a>(&'a self) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-Mutex%3CW%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#789-798">source</a><a href="#impl-MakeWriter%3C'a%3E-for-Mutex%3CW%3E" class="anchor">§</a><h3 class="code-header">impl<'a, W> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/sync/mutex/struct.Mutex.html" title="struct std::sync::mutex::Mutex">Mutex</a><W><div class="where">where
|
||
W: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + 'a,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-3" class="associatedtype trait-impl"><a href="#associatedtype.Writer-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="struct" href="writer/struct.MutexGuardWriter.html" title="struct tracing_subscriber::fmt::writer::MutexGuardWriter">MutexGuardWriter</a><'a, W></h4></section><section id="method.make_writer-2" class="method trait-impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#795-797">source</a><a href="#method.make_writer-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.make_writer" class="fn">make_writer</a>(&'a self) -> Self::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a></h4></section></div></details><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-MakeWriter%3C'a%3E-for-TestWriter" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#722-728">source</a><a href="#impl-MakeWriter%3C'a%3E-for-TestWriter" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="struct.TestWriter.html" title="struct tracing_subscriber::fmt::TestWriter">TestWriter</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-4" class="associatedtype trait-impl"><a href="#associatedtype.Writer-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="struct" href="struct.TestWriter.html" title="struct tracing_subscriber::fmt::TestWriter">TestWriter</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-BoxMakeWriter" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#754-766">source</a><a href="#impl-MakeWriter%3C'a%3E-for-BoxMakeWriter" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.BoxMakeWriter.html" title="struct tracing_subscriber::fmt::writer::BoxMakeWriter">BoxMakeWriter</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-5" class="associatedtype trait-impl"><a href="#associatedtype.Writer-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + 'a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-Tee%3CA,+B%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#1032-1048">source</a><a href="#impl-MakeWriter%3C'a%3E-for-Tee%3CA,+B%3E" class="anchor">§</a><h3 class="code-header">impl<'a, A, B> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.Tee.html" title="struct tracing_subscriber::fmt::writer::Tee">Tee</a><A, B><div class="where">where
|
||
A: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>,
|
||
B: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-6" class="associatedtype trait-impl"><a href="#associatedtype.Writer-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="struct" href="writer/struct.Tee.html" title="struct tracing_subscriber::fmt::writer::Tee">Tee</a><<A as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>, <B as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-OrElse%3CA,+B%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#1110-1133">source</a><a href="#impl-MakeWriter%3C'a%3E-for-OrElse%3CA,+B%3E" class="anchor">§</a><h3 class="code-header">impl<'a, A, B, W> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.OrElse.html" title="struct tracing_subscriber::fmt::writer::OrElse">OrElse</a><A, B><div class="where">where
|
||
A: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a, Writer = <a class="type" href="writer/type.OptionalWriter.html" title="type tracing_subscriber::fmt::writer::OptionalWriter">OptionalWriter</a><W>>,
|
||
B: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>,
|
||
W: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-7" class="associatedtype trait-impl"><a href="#associatedtype.Writer-7" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="enum" href="writer/enum.EitherWriter.html" title="enum tracing_subscriber::fmt::writer::EitherWriter">EitherWriter</a><W, <B as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-F" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#672-682">source</a><a href="#impl-MakeWriter%3C'a%3E-for-F" class="anchor">§</a><h3 class="code-header">impl<'a, F, W> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for F<div class="where">where
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -> W,
|
||
W: <a class="trait" href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write">Write</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-8" class="associatedtype trait-impl"><a href="#associatedtype.Writer-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = W</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-WithFilter%3CM,+F%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#995-1015">source</a><a href="#impl-MakeWriter%3C'a%3E-for-WithFilter%3CM,+F%3E" class="anchor">§</a><h3 class="code-header">impl<'a, M, F> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.WithFilter.html" title="struct tracing_subscriber::fmt::writer::WithFilter">WithFilter</a><M, F><div class="where">where
|
||
M: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>,
|
||
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="struct" href="../../tracing_core/metadata/struct.Metadata.html" title="struct tracing_core::metadata::Metadata">Metadata</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-9" class="associatedtype trait-impl"><a href="#associatedtype.Writer-9" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="enum" href="writer/enum.EitherWriter.html" title="enum tracing_subscriber::fmt::writer::EitherWriter">EitherWriter</a><<M as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/util/struct.Sink.html" title="struct std::io::util::Sink">Sink</a>></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-WithMaxLevel%3CM%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#925-941">source</a><a href="#impl-MakeWriter%3C'a%3E-for-WithMaxLevel%3CM%3E" class="anchor">§</a><h3 class="code-header">impl<'a, M: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.WithMaxLevel.html" title="struct tracing_subscriber::fmt::writer::WithMaxLevel">WithMaxLevel</a><M></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-10" class="associatedtype trait-impl"><a href="#associatedtype.Writer-10" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="enum" href="writer/enum.EitherWriter.html" title="enum tracing_subscriber::fmt::writer::EitherWriter">EitherWriter</a><<M as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/util/struct.Sink.html" title="struct std::io::util::Sink">Sink</a>></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-MakeWriter%3C'a%3E-for-WithMinLevel%3CM%3E" class="impl"><a class="src rightside" href="../../src/tracing_subscriber/fmt/writer.rs.html#958-974">source</a><a href="#impl-MakeWriter%3C'a%3E-for-WithMinLevel%3CM%3E" class="anchor">§</a><h3 class="code-header">impl<'a, M: <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>> <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a> for <a class="struct" href="writer/struct.WithMinLevel.html" title="struct tracing_subscriber::fmt::writer::WithMinLevel">WithMinLevel</a><M></h3></section></summary><div class="impl-items"><section id="associatedtype.Writer-11" class="associatedtype trait-impl"><a href="#associatedtype.Writer-11" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Writer" class="associatedtype">Writer</a> = <a class="enum" href="writer/enum.EitherWriter.html" title="enum tracing_subscriber::fmt::writer::EitherWriter">EitherWriter</a><<M as <a class="trait" href="trait.MakeWriter.html" title="trait tracing_subscriber::fmt::MakeWriter">MakeWriter</a><'a>>::<a class="associatedtype" href="trait.MakeWriter.html#associatedtype.Writer" title="type tracing_subscriber::fmt::MakeWriter::Writer">Writer</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/std/io/util/struct.Sink.html" title="struct std::io::util::Sink">Sink</a>></h4></section></div></details></div><script src="../../trait.impl/tracing_subscriber/fmt/writer/trait.MakeWriter.js" data-ignore-extern-crates="alloc,std" async></script></section></div></main></body></html> |