Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

View File

@@ -0,0 +1 @@
<!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="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="displaydoc" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">All</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../displaydoc/index.html">displaydoc</a><span class="version">0.2.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#derives">Crate Items</a></h3><ul class="block"><li><a href="#derives" title="Derive Macros">Derive Macros</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>List of all items</h1><rustdoc-toolbar></rustdoc-toolbar></div><h3 id="derives">Derive Macros</h3><ul class="all-items"><li><a href="derive.Display.html">Display</a></li></ul></section></div></main></body></html>

View File

@@ -0,0 +1,51 @@
<!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="Custom `#[derive(...)]` macro for implementing `fmt::Display` via doc comment attributes."><title>Display in displaydoc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="displaydoc" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc derive"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Display</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../displaydoc/index.html">displaydoc</a><span class="version">0.2.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Display</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#generic-type-parameters" title="Generic Type Parameters">Generic Type Parameters</a></li><li><a href="#using-debug-implementations-with-type-parameters" title="Using `Debug` Implementations with Type Parameters">Using <code>Debug</code> Implementations with Type Parameters</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate displaydoc</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">displaydoc</a></div><h1>Derive Macro <span class="derive">Display</span>&nbsp;<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/displaydoc/lib.rs.html#181-186">Source</a> </span></div><pre class="rust item-decl"><code>#[derive(Display)]
{
<span class="comment">// Attributes available to this derive:</span>
#[ignore_extra_doc_attributes]
#[prefix_enum_doc_attributes]
#[displaydoc]
}
</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="https://doc.rust-lang.org/edition-guide/rust-2018/macros/custom-derive.html">Custom <code>#[derive(...)]</code> macro</a>
for implementing <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Display.html" title="trait core::fmt::Display"><code>fmt::Display</code></a> via doc comment attributes.</p>
<h4 id="generic-type-parameters"><a class="doc-anchor" href="#generic-type-parameters">§</a>Generic Type Parameters</h4>
<p>Type parameters to an enum or struct using this macro should <em>not</em> need to
have an explicit <code>Display</code> constraint at the struct or enum definition
site. A <code>Display</code> implementation for the <code>derive</code>d struct or enum is
generated assuming each type parameter implements <code>Display</code>, but that should
be possible without adding the constraint to the struct definition itself:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>displaydoc::Display;
<span class="doccomment">/// oh no, an error: {0}
</span><span class="attr">#[derive(Display)]
</span><span class="kw">pub struct </span>Error&lt;E&gt;(<span class="kw">pub </span>E);
<span class="comment">// No need to require `E: Display`, since `displaydoc::Display` adds that implicitly.
</span><span class="kw">fn </span>generate_error&lt;E&gt;(e: E) -&gt; Error&lt;E&gt; { Error(e) }
<span class="macro">assert!</span>(<span class="string">"oh no, an error: muahaha" </span>== <span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, generate_error(<span class="string">"muahaha"</span>)));</code></pre></div><h4 id="using-debug-implementations-with-type-parameters"><a class="doc-anchor" href="#using-debug-implementations-with-type-parameters">§</a>Using <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug"><code>Debug</code></a> Implementations with Type Parameters</h4>
<p>However, if a type parameter must instead be constrained with the
<a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug"><code>Debug</code></a> trait so that some field may be printed with
<code>{:?}</code>, that constraint must currently still also be specified redundantly
at the struct or enum definition site. If a struct or enum field is being
formatted with <code>{:?}</code> via <a href="index.html" title="mod displaydoc"><code>displaydoc</code></a>, and a generic type
parameter must implement <code>Debug</code> to do that, then that struct or enum
definition will need to propagate the <code>Debug</code> constraint to every type
parameter its instantiated with:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>core::fmt::Debug;
<span class="kw">use </span>displaydoc::Display;
<span class="doccomment">/// oh no, an error: {0:?}
</span><span class="attr">#[derive(Display)]
</span><span class="kw">pub struct </span>Error&lt;E: Debug&gt;(<span class="kw">pub </span>E);
<span class="comment">// `E: Debug` now has to propagate to callers.
</span><span class="kw">fn </span>generate_error&lt;E: Debug&gt;(e: E) -&gt; Error&lt;E&gt; { Error(e) }
<span class="macro">assert!</span>(<span class="string">"oh no, an error: \"cool\"" </span>== <span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, generate_error(<span class="string">"cool"</span>)));
<span class="comment">// Try this with a struct that doesn't impl `Display` at all, unlike `str`.
</span><span class="attr">#[derive(Debug)]
</span><span class="kw">pub struct </span>Oh;
<span class="macro">assert!</span>(<span class="string">"oh no, an error: Oh" </span>== <span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, generate_error(Oh)));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,100 @@
<!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="This library provides a convenient derive macro for the standard librarys `core::fmt::Display` trait."><title>displaydoc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.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"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="displaydoc" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate displaydoc</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../displaydoc/index.html">displaydoc</a><span class="version">0.2.5</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li><li><a href="#details" title="Details">Details</a></li><li><a href="#faq" title="FAQ">FAQ</a></li></ul><h3><a href="#derives">Crate Items</a></h3><ul class="block"><li><a href="#derives" title="Derive Macros">Derive Macros</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>displaydoc</span>&nbsp;<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/displaydoc/lib.rs.html#1-186">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This library provides a convenient derive macro for the standard librarys
<a href="https://doc.rust-lang.org/std/fmt/trait.Display.html"><code>core::fmt::Display</code></a> trait.</p>
<div class="example-wrap"><pre class="language-toml"><code>[dependencies]
displaydoc = &quot;0.2&quot;</code></pre></div>
<p><em>Compiler support: requires rustc 1.56+</em></p>
<br>
<h3 id="example"><a class="doc-anchor" href="#example">§</a>Example</h3>
<p><em>Demonstration alongside the <a href="https://doc.rust-lang.org/1.93.1/core/error/trait.Error.html" title="trait core::error::Error"><code>Error</code></a> derive macro from <a href="https://docs.rs/thiserror/1.0.25/thiserror/index.html"><code>thiserror</code></a>,
to propagate source locations from <a href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error"><code>io::Error</code></a> with the <code>#[source]</code> attribute:</em></p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io;
<span class="kw">use </span>displaydoc::Display;
<span class="kw">use </span>thiserror::Error;
<span class="attr">#[derive(Display, Error, Debug)]
</span><span class="kw">pub enum </span>DataStoreError {
<span class="doccomment">/// data store disconnected
</span>Disconnect(<span class="attr">#[source] </span>io::Error),
<span class="doccomment">/// the data for key `{0}` is not available
</span>Redaction(String),
<span class="doccomment">/// invalid header (expected {expected:?}, found {found:?})
</span>InvalidHeader {
expected: String,
found: String,
},
<span class="doccomment">/// unknown data store error
</span>Unknown,
}
<span class="kw">let </span>error = DataStoreError::Redaction(<span class="string">"CLASSIFIED CONTENT"</span>.to_string());
<span class="macro">assert!</span>(<span class="string">"the data for key `CLASSIFIED CONTENT` is not available" </span>== <span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, error));</code></pre></div>
<p><em>Note that although <a href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error"><code>io::Error</code></a> implements <code>Display</code>, we do not add it to the
generated message for <code>DataStoreError::Disconnect</code>, since it is already made available via
<code>#[source]</code>. See further context on avoiding duplication in error reports at the rust blog
<a href="https://github.com/yaahc/blog.rust-lang.org/blob/master/posts/inside-rust/2021-05-15-What-the-error-handling-project-group-is-working-towards.md#duplicate-information-issue">here</a>.</em></p>
<br>
<h3 id="details"><a class="doc-anchor" href="#details">§</a>Details</h3>
<ul>
<li>A <code>fmt::Display</code> impl is generated for your enum if you provide
a docstring comment on each variant as shown above in the example. The
<code>Display</code> derive macro supports a shorthand for interpolating fields from
the error:
<ul>
<li><code>/// {var}</code><code>write!("{}", self.var)</code></li>
<li><code>/// {0}</code><code>write!("{}", self.0)</code></li>
<li><code>/// {var:?}</code><code>write!("{:?}", self.var)</code></li>
<li><code>/// {0:?}</code><code>write!("{:?}", self.0)</code></li>
</ul>
</li>
<li>This also works with structs and <a href="derive.Display.html#generic-type-parameters" title="derive displaydoc::Display">generic types</a>:</li>
</ul>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="doccomment">/// oh no, an error: {0}
</span><span class="attr">#[derive(Display)]
</span><span class="kw">pub struct </span>Error&lt;E&gt;(<span class="kw">pub </span>E);
<span class="kw">let </span>error: Error&lt;<span class="kw-2">&amp;</span>str&gt; = Error(<span class="string">"muahaha i am an error"</span>);
<span class="macro">assert!</span>(<span class="string">"oh no, an error: muahaha i am an error" </span>== <span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, error));</code></pre></div>
<ul>
<li>
<p>Two optional attributes can be added to your types next to the derive:</p>
<ul>
<li>
<p><code>#[ignore_extra_doc_attributes]</code> makes the macro ignore any doc
comment attributes (or <code>///</code> lines) after the first. Multi-line
comments using <code>///</code> are otherwise treated as an error, so use this
attribute or consider switching to block doc comments (<code>/** */</code>).</p>
</li>
<li>
<p><code>#[prefix_enum_doc_attributes]</code> combines the doc comment message on
your enum itself with the messages for each variant, in the format
“enum: variant”. When added to an enum, the doc comment on the enum
becomes mandatory. When added to any other type, it has no effect.</p>
</li>
</ul>
</li>
<li>
<p>In case you want to have an independent doc comment, the
<code>#[displaydoc("...")</code> atrribute may be used on the variant or struct to
override it.</p>
</li>
</ul>
<br>
<h3 id="faq"><a class="doc-anchor" href="#faq">§</a>FAQ</h3>
<ol>
<li>
<p><strong>Is this crate <code>no_std</code> compatible?</strong></p>
<ul>
<li>Yes! This crate implements the <a href="https://doc.rust-lang.org/std/fmt/trait.Display.html"><code>core::fmt::Display</code></a> trait, not the <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Display.html" title="trait core::fmt::Display"><code>std::fmt::Display</code></a> trait, so it should work in <code>std</code> and <code>no_std</code> environments. Just add <code>default-features = false</code>.</li>
</ul>
</li>
<li>
<p><strong>Does this crate work with <code>Path</code> and <code>PathBuf</code> via the <code>Display</code> trait?</strong></p>
<ul>
<li>Yuuup. This crate uses @dtolnays <a href="https://github.com/dtolnay/case-studies/blob/master/autoref-specialization/README.md">autoref specialization technique</a> to add a special trait for types to get the display impl. It then specializes for <code>Path</code> and <code>PathBuf</code>, and when either of these types are found, it calls <code>self.display()</code> to get a <code>std::path::Display&lt;'_&gt;</code> type which can be used with the <code>Display</code> format specifier!</li>
</ul>
</li>
</ol>
</div></details><h2 id="derives" class="section-header">Derive Macros<a href="#derives" class="anchor">§</a></h2><dl class="item-table"><dt><a class="derive" href="derive.Display.html" title="derive displaydoc::Display">Display</a></dt><dd><a href="https://doc.rust-lang.org/edition-guide/rust-2018/macros/custom-derive.html">Custom <code>#[derive(...)]</code> macro</a>
for implementing <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Display.html" title="trait core::fmt::Display"><code>fmt::Display</code></a> via doc comment attributes.</dd></dl></section></div></main></body></html>

View File

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