<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../anstream/all.html"title="show sidebar"></a></div><inputclass="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"><divid="help-button"tabindex="-1"><ahref="../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Crate <aclass="mod"href="#">anstream</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../src/anstream/lib.rs.html#1-81">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p><strong>Auto-adapting <ahref="fn.stdout.html"title="fn anstream::stdout"><code>stdout</code></a> / <ahref="fn.stderr.html"title="fn anstream::stderr"><code>stderr</code></a> streams</strong></p>
</span><spanclass="macro">println!</span>(<spanclass="string">"My number is {:#x}!"</span>, <spanclass="number">10</span>.green());
<spanclass="comment">// Background colors
</span><spanclass="macro">println!</span>(<spanclass="string">"My number is not {}!"</span>, <spanclass="number">4</span>.on_red());</code></pre></div>
<p>And this will correctly handle piping to a file, etc</p>
</div></details><h2id="reexports"class="section-header">Re-exports<ahref="#reexports"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"id="reexport.Buffer"><code>pub use buffer::Buffer;</code></div><divclass="desc docblock-short"><spanclass="stab deprecated"title="">Deprecated</span></div></li></ul><h2id="modules"class="section-header">Modules<ahref="#modules"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="mod"href="adapter/index.html"title="mod anstream::adapter">adapter</a></div><divclass="desc docblock-short">Gracefully degrade styled output</div></li><li><divclass="item-name"><aclass="mod"href="stream/index.html"title="mod anstream::stream">stream</a></div><divclass="desc docblock-short">Higher-level traits to describe writeable streams</div></li></ul><h2id="macros"class="section-header">Macros<ahref="#macros"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="macro"href="macro.eprint.html"title="macro anstream::eprint">eprint</a></div><divclass="desc docblock-short">Prints to <ahref="fn.stderr.html"title="fn anstream::stderr"><code>stderr</code></a>.</div></li><li><divclass="item-name"><aclass="macro"href="macro.eprintln.html"title="macro anstream::eprintln">eprintln</a></div><divclass="desc docblock-short">Prints to <ahref="fn.stderr.html"title="fn anstream::stderr"><code>stderr</code></a>, with a newline.</div></li><li><divclass="item-name"><aclass="macro"href="macro.panic.html"title="macro anstream::panic">panic</a></div><divclass="desc docblock-short">Panics the current thread.</div></li><li><divclass="item-name"><aclass="macro"href="macro.print.html"title="macro anstream::print">print</a></div><divclass="desc docblock-short">Prints to <ahref="fn.stdout.html"title="fn anstream::stdout"><code>stdout</code></a>.</div></li><li><divclass="item-name"><aclass="macro"href="macro.println.html"title="macro anstream::println">println</a></div><divclass="desc docblock-short">Prints to <ahref="fn.stdout.html"title="fn anstream::stdout"><code>stdout</code></a>, with a newline.</div></li></ul><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.AutoStream.html"title="struct anstream::AutoStream">AutoStream</a></div><divclass="desc docblock-short"><ahref="https://doc.rust-lang.org/1.77.0/std/io/trait.Write.html"title="trait std::io::Write"><code>std::io::Write</code></a> that adapts ANSI escape codes to the underlying <code>Write</code>s capabilities</div></li><li><divclass="item-name"><aclass="struct"href="struct.StripStream.html"title="struct anstream::StripStream">StripStream</a></div><divclass="desc docblock-short">Only pass printable data to the inner <code>Write</code></div></li></ul><h2id="enums"class="section-header">Enums<ahref="#enums"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="enum"href="enum.ColorChoice.html"title="enum anstream::ColorChoice">ColorChoice</a></div><divclass="desc docblock-short">Selection for overriding color output
Selection for overriding color output</div></li></ul><h2id="functions"class="section-header">Functions<ahref="#functions"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="fn"href="fn.stderr.html"title="fn anstream::stderr">stderr</a></div><divclass="desc docblock-short">Create an ANSI escape code compatible stderr</div></li><li><divclass="item-name"><aclass="fn"href="fn.stdout.html"title="fn anstream::stdout">stdout</a></div><divclass="desc docblock-short">Create an ANSI escape code compatible stdout</div></li></ul><h2id="types"class="section-header">Type Aliases<ahref="#types"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="type"href="type.Stderr.html"title="type anstream::Stderr">Stderr</a></div></li><li><divclass="item-name"><aclass="type"href="type.Stdout.html"title="type anstream::Stdout">Stdout</a></div></li></ul></section></div></main></body></html>