Files
GopherGate/target/doc/serde/ser/trait.StdError.html
2026-02-26 12:00:21 -05:00

313 lines
104 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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="`Error` is a trait representing the basic expectations for error values, i.e., values of type `E` in `Result&#60;T, E&#62;`."><title>StdError in serde::ser - 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="serde" 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 trait"><!--[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="#">StdError</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../serde/index.html">serde</a><span class="version">1.0.228</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">StdError</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#error-source" title="Error source">Error source</a></li><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.cause" title="cause">cause</a></li><li><a href="#method.description" title="description">description</a></li><li><a href="#method.provide" title="provide">provide</a></li><li><a href="#method.source" title="source">source</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.downcast" title="downcast">downcast</a></li><li><a href="#method.downcast-1" title="downcast">downcast</a></li><li><a href="#method.downcast-2" title="downcast">downcast</a></li><li><a href="#method.downcast_mut" title="downcast_mut">downcast_mut</a></li><li><a href="#method.downcast_mut-1" title="downcast_mut">downcast_mut</a></li><li><a href="#method.downcast_mut-2" title="downcast_mut">downcast_mut</a></li><li><a href="#method.downcast_ref" title="downcast_ref">downcast_ref</a></li><li><a href="#method.downcast_ref-1" title="downcast_ref">downcast_ref</a></li><li><a href="#method.downcast_ref-2" title="downcast_ref">downcast_ref</a></li><li><a href="#method.is" title="is">is</a></li><li><a href="#method.is-1" title="is">is</a></li><li><a href="#method.is-2" title="is">is</a></li><li><a href="#method.sources" title="sources">sources</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-From%3C%26str%3E-for-Box%3Cdyn+Error%3E" title="From&#60;&#38;str&#62;">From&#60;&#38;str&#62;</a></li><li><a href="#impl-From%3C%26str%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" title="From&#60;&#38;str&#62;">From&#60;&#38;str&#62;</a></li><li><a href="#impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error%3E" title="From&#60;Cow&#60;&#39;b, str&#62;&#62;">From&#60;Cow&#60;&#39;b, str&#62;&#62;</a></li><li><a href="#impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" title="From&#60;Cow&#60;&#39;b, str&#62;&#62;">From&#60;Cow&#60;&#39;b, str&#62;&#62;</a></li><li><a href="#impl-From%3CE%3E-for-Box%3Cdyn+Error%3E" title="From&#60;E&#62;">From&#60;E&#62;</a></li><li><a href="#impl-From%3CE%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" title="From&#60;E&#62;">From&#60;E&#62;</a></li><li><a href="#impl-From%3CString%3E-for-Box%3Cdyn+Error%3E" title="From&#60;String&#62;">From&#60;String&#62;</a></li><li><a href="#impl-From%3CString%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" title="From&#60;String&#62;">From&#60;String&#62;</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In serde::<wbr>ser</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">serde</a>::<wbr><a href="index.html">ser</a></div><h1>Trait <span class="trait">StdError</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"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#59">Source</a> </span></div><pre class="rust item-decl"><code>pub trait StdError: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> {
// Provided methods
fn <a href="#method.source" class="fn">source</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;(dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static)&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.description" class="fn">description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.cause" class="fn">cause</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.provide" class="fn">provide</a>&lt;'a&gt;(&amp;'a self, request: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/error/struct.Request.html" title="struct core::error::Request">Request</a>&lt;'a&gt;) { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>Error</code> is a trait representing the basic expectations for error values,
i.e., values of type <code>E</code> in <a href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result"><code>Result&lt;T, E&gt;</code></a>.</p>
<p>Errors must describe themselves through the <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Display.html" title="trait core::fmt::Display"><code>Display</code></a> and <a href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug"><code>Debug</code></a>
traits. Error messages are typically concise lowercase sentences without
trailing punctuation:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>err = <span class="string">"NaN"</span>.parse::&lt;u32&gt;().unwrap_err();
<span class="macro">assert_eq!</span>(err.to_string(), <span class="string">"invalid digit found in string"</span>);</code></pre></div><h2 id="error-source"><a class="doc-anchor" href="#error-source">§</a>Error source</h2>
<p>Errors may provide cause information. <a href="../de/trait.StdError.html#method.source" title="method serde::de::StdError::source"><code>Error::source()</code></a> is generally
used when errors cross “abstraction boundaries”. If one module must report
an error that is caused by an error from a lower-level module, it can allow
accessing that error via <code>Error::source()</code>. This makes it possible for the
high-level module to provide its own errors while also revealing some of the
implementation for debugging.</p>
<p>In error types that wrap an underlying error, the underlying error
should be either returned by the outer errors <code>Error::source()</code>, or rendered
by the outer errors <code>Display</code> implementation, but not both.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>Implementing the <code>Error</code> trait only requires that <code>Debug</code> and <code>Display</code> are implemented too.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::fmt;
<span class="kw">use </span>std::path::PathBuf;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>ReadConfigError {
path: PathBuf
}
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>ReadConfigError {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="kw">let </span>path = <span class="self">self</span>.path.display();
<span class="macro">write!</span>(f, <span class="string">"unable to read configuration at {path}"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>ReadConfigError {}</code></pre></div></div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.source" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#111">Source</a></span><h4 class="code-header">fn <a href="#method.source" class="fn">source</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;(dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static)&gt;</h4></section></summary><div class="docblock"><p>Returns the lower-level source of this error, if any.</p>
<h5 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::fmt;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>SuperError {
source: SuperErrorSideKick,
}
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>SuperError {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"SuperError is here!"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>SuperError {
<span class="kw">fn </span>source(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>(<span class="kw">dyn </span>Error + <span class="lifetime">'static</span>)&gt; {
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.source)
}
}
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>SuperErrorSideKick;
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>SuperErrorSideKick {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"SuperErrorSideKick is here!"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>SuperErrorSideKick {}
<span class="kw">fn </span>get_super_error() -&gt; <span class="prelude-ty">Result</span>&lt;(), SuperError&gt; {
<span class="prelude-val">Err</span>(SuperError { source: SuperErrorSideKick })
}
<span class="kw">fn </span>main() {
<span class="kw">match </span>get_super_error() {
<span class="prelude-val">Err</span>(e) =&gt; {
<span class="macro">println!</span>(<span class="string">"Error: {e}"</span>);
<span class="macro">println!</span>(<span class="string">"Caused by: {}"</span>, e.source().unwrap());
}
<span class="kw">_ </span>=&gt; <span class="macro">println!</span>(<span class="string">"No error"</span>),
}
}</code></pre></div></div></details><details class="toggle method-toggle" open><summary><section id="method.description" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#137">Source</a></span><h4 class="code-header">fn <a href="#method.description" class="fn">description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.42.0: use the Display impl or to_string()</span></div></span></summary><div class="docblock">
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">if let </span><span class="prelude-val">Err</span>(e) = <span class="string">"xc"</span>.parse::&lt;u32&gt;() {
<span class="comment">// Print `e` itself, no need for description().
</span><span class="macro">eprintln!</span>(<span class="string">"Error: {e}"</span>);
}</code></pre></div></div></details><section id="method.cause" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#147">Source</a></span><h4 class="code-header">fn <a href="#method.cause" class="fn">cause</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a>&gt;</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.33.0: replaced by Error::source, which can support downcasting</span></div></span><details class="toggle method-toggle" open><summary><section id="method.provide" class="method"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#210">Source</a><h4 class="code-header">fn <a href="#method.provide" class="fn">provide</a>&lt;'a&gt;(&amp;'a self, request: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/error/struct.Request.html" title="struct core::error::Request">Request</a>&lt;'a&gt;)</h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>error_generic_member_access</code>)</span></div></span></summary><div class="docblock"><p>Provides type-based access to context intended for error reports.</p>
<p>Used in conjunction with <a href="https://doc.rust-lang.org/1.93.1/core/error/struct.Request.html#method.provide_value" title="method core::error::Request::provide_value"><code>Request::provide_value</code></a> and <a href="https://doc.rust-lang.org/1.93.1/core/error/struct.Request.html#method.provide_ref" title="method core::error::Request::provide_ref"><code>Request::provide_ref</code></a> to extract
references to member variables from <code>dyn Error</code> trait objects.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(error_generic_member_access)]
</span><span class="kw">use </span>core::fmt;
<span class="kw">use </span>core::error::{request_ref, Request};
<span class="attr">#[derive(Debug)]
</span><span class="kw">enum </span>MyLittleTeaPot {
Empty,
}
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>MyBacktrace {
<span class="comment">// ...
</span>}
<span class="kw">impl </span>MyBacktrace {
<span class="kw">fn </span>new() -&gt; MyBacktrace {
<span class="comment">// ...
</span>}
}
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>Error {
backtrace: MyBacktrace,
}
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>Error {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"Example Error"</span>)
}
}
<span class="kw">impl </span>std::error::Error <span class="kw">for </span>Error {
<span class="kw">fn </span>provide&lt;<span class="lifetime">'a</span>&gt;(<span class="kw-2">&amp;</span><span class="lifetime">'a </span><span class="self">self</span>, request: <span class="kw-2">&amp;mut </span>Request&lt;<span class="lifetime">'a</span>&gt;) {
request
.provide_ref::&lt;MyBacktrace&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>.backtrace);
}
}
<span class="kw">fn </span>main() {
<span class="kw">let </span>backtrace = MyBacktrace::new();
<span class="kw">let </span>error = Error { backtrace };
<span class="kw">let </span>dyn_error = <span class="kw-2">&amp;</span>error <span class="kw">as </span><span class="kw-2">&amp;</span><span class="kw">dyn </span>std::error::Error;
<span class="kw">let </span>backtrace_ref = request_ref::&lt;MyBacktrace&gt;(dyn_error).unwrap();
<span class="macro">assert!</span>(core::ptr::eq(<span class="kw-2">&amp;</span>error.backtrace, backtrace_ref));
<span class="macro">assert!</span>(request_ref::&lt;MyLittleTeaPot&gt;(dyn_error).is_none());
}</code></pre></div></div></details></div><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#225">Source</a><a href="#impl-dyn+Error" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#229">Source</a></span><h4 class="code-header">pub fn <a href="#method.is" class="fn">is</a>&lt;T&gt;(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a><div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the inner type is the same as <code>T</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_ref" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#244">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_ref" class="fn">downcast_ref</a>&lt;T&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Returns some reference to the inner value if it is of type <code>T</code>, or
<code>None</code> if it isnt.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_mut" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#257">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_mut" class="fn">downcast_mut</a>&lt;T&gt;(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Returns some mutable reference to the inner value if it is of type <code>T</code>, or
<code>None</code> if it isnt.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error+%2B+Send" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#267">Source</a><a href="#impl-dyn+Error+%2B+Send" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#271">Source</a></span><h4 class="code-header">pub fn <a href="#method.is-1" class="fn">is</a>&lt;T&gt;(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a><div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_ref-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#278">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_ref-1" class="fn">downcast_ref</a>&lt;T&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_mut-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#285">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_mut-1" class="fn">downcast_mut</a>&lt;T&gt;(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error+%2B+Send+%2B+Sync" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#290">Source</a><a href="#impl-dyn+Error+%2B+Send+%2B+Sync" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is-2" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#294">Source</a></span><h4 class="code-header">pub fn <a href="#method.is-2" class="fn">is</a>&lt;T&gt;(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a><div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_ref-2" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#301">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_ref-2" class="fn">downcast_ref</a>&lt;T&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.downcast_mut-2" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#308">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast_mut-2" class="fn">downcast_mut</a>&lt;T&gt;(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;mut T</a>&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Forwards to the method defined on the type <code>dyn Error</code>.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error-1" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#313">Source</a><a href="#impl-dyn+Error-1" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.sources" class="method"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#367">Source</a><h4 class="code-header">pub fn <a href="#method.sources" class="fn">sources</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/error/struct.Source.html" title="struct core::error::Source">Source</a>&lt;'_&gt; <a href="#" class="tooltip" data-notable-ty="Source&lt;&#39;_&gt;"></a></h4></section><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>error_iter</code>)</span></div></span></summary><div class="docblock"><p>Returns an iterator starting with the current error and continuing with
recursively calling <a href="../de/trait.StdError.html#method.source" title="method serde::de::StdError::source"><code>Error::source</code></a>.</p>
<p>If you want to omit the current error and only use its sources,
use <code>skip(1)</code>.</p>
<h5 id="examples-1"><a class="doc-anchor" href="#examples-1">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#![feature(error_iter)]
</span><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::fmt;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>A;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>B(<span class="prelude-ty">Option</span>&lt;Box&lt;<span class="kw">dyn </span>Error + <span class="lifetime">'static</span>&gt;&gt;);
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>A {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"A"</span>)
}
}
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>B {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"B"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>A {}
<span class="kw">impl </span>Error <span class="kw">for </span>B {
<span class="kw">fn </span>source(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>(<span class="kw">dyn </span>Error + <span class="lifetime">'static</span>)&gt; {
<span class="self">self</span>.<span class="number">0</span>.as_ref().map(|e| e.as_ref())
}
}
<span class="kw">let </span>b = B(<span class="prelude-val">Some</span>(Box::new(A)));
<span class="comment">// let err : Box&lt;Error&gt; = b.into(); // or
</span><span class="kw">let </span>err = <span class="kw-2">&amp;</span>b <span class="kw">as </span><span class="kw-2">&amp;</span><span class="kw">dyn </span>Error;
<span class="kw">let </span><span class="kw-2">mut </span>iter = err.sources();
<span class="macro">assert_eq!</span>(<span class="string">"B"</span>.to_string(), iter.next().unwrap().to_string());
<span class="macro">assert_eq!</span>(<span class="string">"A"</span>.to_string(), iter.next().unwrap().to_string());
<span class="macro">assert!</span>(iter.next().is_none());
<span class="macro">assert!</span>(iter.next().is_none());</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error-2" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#705">Source</a><a href="#impl-dyn+Error-2" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.downcast" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#710">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast" class="fn">downcast</a>&lt;T&gt;(self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a>&gt;&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Attempts to downcast the box to a concrete type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error+%2B+Send-1" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#722">Source</a><a href="#impl-dyn+Error+%2B+Send-1" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.downcast-1" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#727">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast-1" class="fn">downcast</a>&lt;T&gt;(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Attempts to downcast the box to a concrete type.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-dyn+Error+%2B+Send+%2B+Sync-1" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#736">Source</a><a href="#impl-dyn+Error+%2B+Send+%2B+Sync-1" class="anchor">§</a><h3 class="code-header">impl dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.downcast-2" class="method"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#741">Source</a></span><h4 class="code-header">pub fn <a href="#method.downcast-2" class="fn">downcast</a>&lt;T&gt;(
self: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'static,</div></h4></section></summary><div class="docblock"><p>Attempts to downcast the box to a concrete type.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26str%3E-for-Box%3Cdyn+Error%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#645">Source</a></span><a href="#impl-From%3C%26str%3E-for-Box%3Cdyn+Error%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-5" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#659">Source</a><a href="#method.from-5" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html" title="primitive str"><code>str</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a>.</p>
<h5 id="examples-7"><a class="doc-anchor" href="#examples-7">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">let </span>a_str_error = <span class="string">"a str error"</span>;
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error&gt;::from(a_str_error);
<span class="macro">assert!</span>(size_of::&lt;Box&lt;<span class="kw">dyn </span>Error&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3C%26str%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#622">Source</a></span><a href="#impl-From%3C%26str%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-4" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#638">Source</a><a href="#method.from-4" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html" title="primitive str"><code>str</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
<h5 id="examples-6"><a class="doc-anchor" href="#examples-6">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">let </span>a_str_error = <span class="string">"a str error"</span>;
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;::from(a_str_error);
<span class="macro">assert!</span>(
size_of::&lt;Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.22.0">1.22.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#687">Source</a></span><a href="#impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, 'b&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'b, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-7" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#700">Source</a><a href="#method.from-7" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: <a class="enum" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'b, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow"><code>Cow</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a>.</p>
<h5 id="examples-9"><a class="doc-anchor" href="#examples-9">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::borrow::Cow;
<span class="kw">let </span>a_cow_str_error = Cow::from(<span class="string">"a str error"</span>);
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error&gt;::from(a_cow_str_error);
<span class="macro">assert!</span>(size_of::&lt;Box&lt;<span class="kw">dyn </span>Error&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.22.0">1.22.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#666">Source</a></span><a href="#impl-From%3CCow%3C'b,+str%3E%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, 'b&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'b, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-6" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#680">Source</a><a href="#method.from-6" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: <a class="enum" href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'b, <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a>&gt;) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow"><code>Cow</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
<h5 id="examples-8"><a class="doc-anchor" href="#examples-8">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::borrow::Cow;
<span class="kw">let </span>a_cow_str_error = Cow::from(<span class="string">"a str error"</span>);
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;::from(a_cow_str_error);
<span class="macro">assert!</span>(
size_of::&lt;Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CE%3E-for-Box%3Cdyn+Error%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#493">Source</a></span><a href="#impl-From%3CE%3E-for-Box%3Cdyn+Error%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, E&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;<div class="where">where
E: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#518">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: E) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a type of <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a>.</p>
<h5 id="examples-2"><a class="doc-anchor" href="#examples-2">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::fmt;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>AnError;
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>AnError {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"An error"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>AnError {}
<span class="kw">let </span>an_error = AnError;
<span class="macro">assert!</span>(<span class="number">0 </span>== size_of_val(<span class="kw-2">&amp;</span>an_error));
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error&gt;::from(an_error);
<span class="macro">assert!</span>(size_of::&lt;Box&lt;<span class="kw">dyn </span>Error&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CE%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#525">Source</a></span><a href="#impl-From%3CE%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, E&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;<div class="where">where
E: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'a,</div></h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#556">Source</a><a href="#method.from-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: E) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a type of <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a> into a box of
dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
<h5 id="examples-3"><a class="doc-anchor" href="#examples-3">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">use </span>std::fmt;
<span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>AnError;
<span class="kw">impl </span>fmt::Display <span class="kw">for </span>AnError {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; fmt::Result {
<span class="macro">write!</span>(f, <span class="string">"An error"</span>)
}
}
<span class="kw">impl </span>Error <span class="kw">for </span>AnError {}
<span class="kw">unsafe impl </span>Send <span class="kw">for </span>AnError {}
<span class="kw">unsafe impl </span>Sync <span class="kw">for </span>AnError {}
<span class="kw">let </span>an_error = AnError;
<span class="macro">assert!</span>(<span class="number">0 </span>== size_of_val(<span class="kw-2">&amp;</span>an_error));
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;::from(an_error);
<span class="macro">assert!</span>(
size_of::&lt;Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CString%3E-for-Box%3Cdyn+Error%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#601">Source</a></span><a href="#impl-From%3CString%3E-for-Box%3Cdyn+Error%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-3" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#613">Source</a><a href="#method.from-3" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(str_err: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a>.</p>
<h5 id="examples-5"><a class="doc-anchor" href="#examples-5">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">let </span>a_string_error = <span class="string">"a string error"</span>.to_string();
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error&gt;::from(a_string_error);
<span class="macro">assert!</span>(size_of::&lt;Box&lt;<span class="kw">dyn </span>Error&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-From%3CString%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#563">Source</a></span><a href="#impl-From%3CString%3E-for-Box%3Cdyn+Error+%2B+Send+%2B+Sync%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt; for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>non-<code>no_global_oom_handling</code></strong> only.</div></span></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/convert.rs.html#577">Source</a><a href="#method.from-2" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.93.1/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(err: <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'a&gt;</h4></section></summary><div class="docblock"><p>Converts a <a href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.String.html" title="struct alloc::string::String"><code>String</code></a> into a box of dyn <a href="../de/trait.StdError.html" title="trait serde::de::StdError"><code>Error</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a>.</p>
<h5 id="examples-4"><a class="doc-anchor" href="#examples-4">§</a>Examples</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::error::Error;
<span class="kw">let </span>a_string_error = <span class="string">"a string error"</span>.to_string();
<span class="kw">let </span>a_boxed_error = Box::&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;::from(a_string_error);
<span class="macro">assert!</span>(
size_of::&lt;Box&lt;<span class="kw">dyn </span>Error + Send + Sync&gt;&gt;() == size_of_val(<span class="kw-2">&amp;</span>a_boxed_error))</code></pre></div></div></details></div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Error-for-%26str" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.65.0">1.65.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/str/mod.rs.html#3216">Source</a></span><a href="#impl-Error-for-%26str" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for &amp;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.str.html">str</a></h3></section><section id="impl-Error-for-Infallible" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.8.0">1.8.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/convert/mod.rs.html#955">Source</a></span><a href="#impl-Error-for-Infallible" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h3></section><section id="impl-Error-for-FromBytesWithNulError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.17.0">1.17.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/ffi/c_str.rs.html#150">Source</a></span><a href="#impl-Error-for-FromBytesWithNulError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/ffi/c_str/enum.FromBytesWithNulError.html" title="enum core::ffi::c_str::FromBytesWithNulError">FromBytesWithNulError</a></h3></section><section id="impl-Error-for-GetDisjointMutError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.86.0">1.86.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1084">Source</a></span><a href="#impl-Error-for-GetDisjointMutError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/slice/enum.GetDisjointMutError.html" title="enum core::slice::GetDisjointMutError">GetDisjointMutError</a></h3></section><section id="impl-Error-for-VarError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/env.rs.html#299">Source</a></span><a href="#impl-Error-for-VarError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/env/enum.VarError.html" title="enum std::env::VarError">VarError</a></h3></section><section id="impl-Error-for-TryLockError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.89.0">1.89.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/fs.rs.html#472">Source</a></span><a href="#impl-Error-for-TryLockError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for std::fs::<a class="enum" href="https://doc.rust-lang.org/1.93.1/std/fs/enum.TryLockError.html" title="enum std::fs::TryLockError">TryLockError</a></h3></section><section id="impl-Error-for-RecvTimeoutError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpsc.rs.html#1198">Source</a></span><a href="#impl-Error-for-RecvTimeoutError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/sync/mpsc/enum.RecvTimeoutError.html" title="enum std::sync::mpsc::RecvTimeoutError">RecvTimeoutError</a></h3></section><section id="impl-Error-for-TryRecvError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpsc.rs.html#1171">Source</a></span><a href="#impl-Error-for-TryRecvError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/sync/mpsc/enum.TryRecvError.html" title="enum std::sync::mpsc::TryRecvError">TryRecvError</a></h3></section><section id="impl-Error-for-!" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#222">Source</a><a href="#impl-Error-for-!" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.never.html">!</a></h3></section><section id="impl-Error-for-Error" class="impl"><a class="src rightside" href="../../src/serde_core/de/value.rs.html#117">Source</a><a href="#impl-Error-for-Error" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for serde::de::value::<a class="struct" href="../de/value/struct.Error.html" title="struct serde::de::value::Error">Error</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>std</code></strong> only.</div></span></section><section id="impl-Error-for-UnorderedKeyError" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/collections/btree/map.rs.html#3570">Source</a><a href="#impl-Error-for-UnorderedKeyError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/collections/btree/map/struct.UnorderedKeyError.html" title="struct alloc::collections::btree::map::UnorderedKeyError">UnorderedKeyError</a></h3></section><section id="impl-Error-for-TryReserveError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.57.0">1.57.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/collections/mod.rs.html#181">Source</a></span><a href="#impl-Error-for-TryReserveError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/collections/struct.TryReserveError.html" title="struct alloc::collections::TryReserveError">TryReserveError</a></h3></section><section id="impl-Error-for-FromVecWithNulError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.58.0">1.58.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/ffi/c_str.rs.html#1286">Source</a></span><a href="#impl-Error-for-FromVecWithNulError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/ffi/c_str/struct.FromVecWithNulError.html" title="struct alloc::ffi::c_str::FromVecWithNulError">FromVecWithNulError</a></h3></section><section id="impl-Error-for-IntoStringError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.7.0">1.7.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/ffi/c_str.rs.html#1289">Source</a></span><a href="#impl-Error-for-IntoStringError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/ffi/c_str/struct.IntoStringError.html" title="struct alloc::ffi::c_str::IntoStringError">IntoStringError</a></h3></section><section id="impl-Error-for-NulError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/ffi/c_str.rs.html#1283">Source</a></span><a href="#impl-Error-for-NulError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/ffi/c_str/struct.NulError.html" title="struct alloc::ffi::c_str::NulError">NulError</a></h3></section><section id="impl-Error-for-FromUtf8Error" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/string.rs.html#2340">Source</a></span><a href="#impl-Error-for-FromUtf8Error" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.FromUtf8Error.html" title="struct alloc::string::FromUtf8Error">FromUtf8Error</a></h3></section><section id="impl-Error-for-FromUtf16Error" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/string.rs.html#2343">Source</a></span><a href="#impl-Error-for-FromUtf16Error" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/string/struct.FromUtf16Error.html" title="struct alloc::string::FromUtf16Error">FromUtf16Error</a></h3></section><section id="impl-Error-for-LayoutError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/alloc/layout.rs.html#537">Source</a></span><a href="#impl-Error-for-LayoutError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/alloc/layout/struct.LayoutError.html" title="struct core::alloc::layout::LayoutError">LayoutError</a></h3></section><section id="impl-Error-for-AllocError" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/core/alloc/mod.rs.html#39">Source</a><a href="#impl-Error-for-AllocError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/alloc/struct.AllocError.html" title="struct core::alloc::AllocError">AllocError</a></h3></section><section id="impl-Error-for-TryFromSliceError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/array/mod.rs.html#193">Source</a></span><a href="#impl-Error-for-TryFromSliceError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/array/struct.TryFromSliceError.html" title="struct core::array::TryFromSliceError">TryFromSliceError</a></h3></section><section id="impl-Error-for-BorrowError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.13.0">1.13.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1069">Source</a></span><a href="#impl-Error-for-BorrowError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/cell/struct.BorrowError.html" title="struct core::cell::BorrowError">BorrowError</a></h3></section><section id="impl-Error-for-BorrowMutError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.13.0">1.13.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1072">Source</a></span><a href="#impl-Error-for-BorrowMutError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/cell/struct.BorrowMutError.html" title="struct core::cell::BorrowMutError">BorrowMutError</a></h3></section><section id="impl-Error-for-CharTryFromError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1075">Source</a></span><a href="#impl-Error-for-CharTryFromError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/char/convert/struct.CharTryFromError.html" title="struct core::char::convert::CharTryFromError">CharTryFromError</a></h3></section><section id="impl-Error-for-ParseCharError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.20.0">1.20.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/char/convert.rs.html#206">Source</a></span><a href="#impl-Error-for-ParseCharError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/char/convert/struct.ParseCharError.html" title="struct core::char::convert::ParseCharError">ParseCharError</a></h3></section><section id="impl-Error-for-DecodeUtf16Error" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.9.0">1.9.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/char/decode.rs.html#129">Source</a></span><a href="#impl-Error-for-DecodeUtf16Error" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/char/decode/struct.DecodeUtf16Error.html" title="struct core::char::decode::DecodeUtf16Error">DecodeUtf16Error</a></h3></section><section id="impl-Error-for-TryFromCharError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.59.0">1.59.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/char/mod.rs.html#605">Source</a></span><a href="#impl-Error-for-TryFromCharError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/char/struct.TryFromCharError.html" title="struct core::char::TryFromCharError">TryFromCharError</a></h3></section><section id="impl-Error-for-FromBytesUntilNulError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.69.0">1.69.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1081">Source</a></span><a href="#impl-Error-for-FromBytesUntilNulError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/ffi/c_str/struct.FromBytesUntilNulError.html" title="struct core::ffi::c_str::FromBytesUntilNulError">FromBytesUntilNulError</a></h3></section><section id="impl-Error-for-Error-1" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1066">Source</a></span><a href="#impl-Error-for-Error-1" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for core::fmt::<a class="struct" href="https://doc.rust-lang.org/1.93.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a></h3></section><section id="impl-Error-for-AddrParseError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.4.0">1.4.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/net/parser.rs.html#514">Source</a></span><a href="#impl-Error-for-AddrParseError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/net/parser/struct.AddrParseError.html" title="struct core::net::parser::AddrParseError">AddrParseError</a></h3></section><section id="impl-Error-for-ParseFloatError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/num/dec2flt/mod.rs.html#222">Source</a></span><a href="#impl-Error-for-ParseFloatError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/num/dec2flt/struct.ParseFloatError.html" title="struct core::num::dec2flt::ParseFloatError">ParseFloatError</a></h3></section><section id="impl-Error-for-ParseIntError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/num/error.rs.html#137">Source</a></span><a href="#impl-Error-for-ParseIntError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/num/error/struct.ParseIntError.html" title="struct core::num::error::ParseIntError">ParseIntError</a></h3></section><section id="impl-Error-for-TryFromIntError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.34.0">1.34.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/num/error.rs.html#20">Source</a></span><a href="#impl-Error-for-TryFromIntError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/num/error/struct.TryFromIntError.html" title="struct core::num::error::TryFromIntError">TryFromIntError</a></h3></section><section id="impl-Error-for-ParseBoolError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/str/error.rs.html#145">Source</a></span><a href="#impl-Error-for-ParseBoolError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/str/error/struct.ParseBoolError.html" title="struct core::str::error::ParseBoolError">ParseBoolError</a></h3></section><section id="impl-Error-for-Utf8Error" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/str/error.rs.html#127">Source</a></span><a href="#impl-Error-for-Utf8Error" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/str/error/struct.Utf8Error.html" title="struct core::str::error::Utf8Error">Utf8Error</a></h3></section><section id="impl-Error-for-TryFromFloatSecsError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.66.0">1.66.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1078">Source</a></span><a href="#impl-Error-for-TryFromFloatSecsError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/time/struct.TryFromFloatSecsError.html" title="struct core::time::TryFromFloatSecsError">TryFromFloatSecsError</a></h3></section><section id="impl-Error-for-JoinPathsError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/env.rs.html#593">Source</a></span><a href="#impl-Error-for-JoinPathsError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/env/struct.JoinPathsError.html" title="struct std::env::JoinPathsError">JoinPathsError</a></h3></section><section id="impl-Error-for-WriterPanicked" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.56.0">1.56.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/io/buffered/bufwriter.rs.html#498">Source</a></span><a href="#impl-Error-for-WriterPanicked" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/buffered/bufwriter/struct.WriterPanicked.html" title="struct std::io::buffered::bufwriter::WriterPanicked">WriterPanicked</a></h3></section><section id="impl-Error-for-Error-2" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/io/error.rs.html#1054">Source</a></span><a href="#impl-Error-for-Error-2" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for std::io::error::<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a></h3></section><section id="impl-Error-for-NormalizeError" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/std/path.rs.html#3919">Source</a><a href="#impl-Error-for-NormalizeError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/path/struct.NormalizeError.html" title="struct std::path::NormalizeError">NormalizeError</a></h3></section><section id="impl-Error-for-StripPrefixError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.7.0">1.7.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/path.rs.html#3910">Source</a></span><a href="#impl-Error-for-StripPrefixError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/path/struct.StripPrefixError.html" title="struct std::path::StripPrefixError">StripPrefixError</a></h3></section><section id="impl-Error-for-ExitStatusError" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/std/process.rs.html#2048">Source</a><a href="#impl-Error-for-ExitStatusError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/process/struct.ExitStatusError.html" title="struct std::process::ExitStatusError">ExitStatusError</a></h3></section><section id="impl-Error-for-RecvError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpsc.rs.html#1158">Source</a></span><a href="#impl-Error-for-RecvError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/sync/mpsc/struct.RecvError.html" title="struct std::sync::mpsc::RecvError">RecvError</a></h3></section><section id="impl-Error-for-AccessError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.26.0">1.26.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/thread/local.rs.html#428">Source</a></span><a href="#impl-Error-for-AccessError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/thread/local/struct.AccessError.html" title="struct std::thread::local::AccessError">AccessError</a></h3></section><section id="impl-Error-for-SystemTimeError" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.8.0">1.8.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/time.rs.html#708">Source</a></span><a href="#impl-Error-for-SystemTimeError" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a></h3></section><section id="impl-Error-for-OccupiedError%3C'a,+K,+V%3E" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/collections/btree/map/entry.rs.html#141-142">Source</a><a href="#impl-Error-for-OccupiedError%3C'a,+K,+V%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, K, V&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for alloc::collections::btree::map::entry::<a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/collections/btree/map/entry/struct.OccupiedError.html" title="struct alloc::collections::btree::map::entry::OccupiedError">OccupiedError</a>&lt;'a, K, V&gt;<div class="where">where
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section><section id="impl-Error-for-OccupiedError%3C'a,+K,+V%3E-1" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/std/collections/hash/map.rs.html#1879">Source</a><a href="#impl-Error-for-OccupiedError%3C'a,+K,+V%3E-1" class="anchor">§</a><h3 class="code-header">impl&lt;'a, K, V&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for std::collections::hash::map::<a class="struct" href="https://doc.rust-lang.org/1.93.1/std/collections/hash/map/struct.OccupiedError.html" title="struct std::collections::hash::map::OccupiedError">OccupiedError</a>&lt;'a, K, V&gt;<div class="where">where
K: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,
V: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section><section id="impl-Error-for-%26T" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/core/error.rs.html#1050">Source</a></span><a href="#impl-Error-for-%26T" class="anchor">§</a><h3 class="code-header">impl&lt;'a, T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a T</a><div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Error-for-Box%3CE%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.8.0">1.8.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed.rs.html#2351">Source</a></span><a href="#impl-Error-for-Box%3CE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;E&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;E&gt;<div class="where">where
E: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a>,</div></h3></section><section id="impl-Error-for-SendTimeoutError%3CT%3E" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpmc/error.rs.html#40">Source</a><a href="#impl-Error-for-SendTimeoutError%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/sync/mpmc/error/enum.SendTimeoutError.html" title="enum std::sync::mpmc::error::SendTimeoutError">SendTimeoutError</a>&lt;T&gt;</h3></section><section id="impl-Error-for-TrySendError%3CT%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpsc.rs.html#1134">Source</a></span><a href="#impl-Error-for-TrySendError%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="enum" href="https://doc.rust-lang.org/1.93.1/std/sync/mpsc/enum.TrySendError.html" title="enum std::sync::mpsc::TrySendError">TrySendError</a>&lt;T&gt;</h3></section><section id="impl-Error-for-TryLockError%3CT%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/poison.rs.html#367">Source</a></span><a href="#impl-Error-for-TryLockError%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for std::sync::poison::<a class="enum" href="https://doc.rust-lang.org/1.93.1/std/sync/poison/enum.TryLockError.html" title="enum std::sync::poison::TryLockError">TryLockError</a>&lt;T&gt;</h3></section><section id="impl-Error-for-ThinBox%3CT%3E" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.93.1/src/alloc/boxed/thin.rs.html#428">Source</a><a href="#impl-Error-for-ThinBox%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/boxed/thin/struct.ThinBox.html" title="struct alloc::boxed::thin::ThinBox">ThinBox</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Error-for-Arc%3CT%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.52.0">1.52.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/alloc/sync.rs.html#4297">Source</a></span><a href="#impl-Error-for-Arc%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section><section id="impl-Error-for-SendError%3CT%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/mpsc.rs.html#1111">Source</a></span><a href="#impl-Error-for-SendError%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/sync/mpsc/struct.SendError.html" title="struct std::sync::mpsc::SendError">SendError</a>&lt;T&gt;</h3></section><section id="impl-Error-for-PoisonError%3CT%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/sync/poison.rs.html#260">Source</a></span><a href="#impl-Error-for-PoisonError%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/sync/poison/struct.PoisonError.html" title="struct std::sync::poison::PoisonError">PoisonError</a>&lt;T&gt;</h3></section><section id="impl-Error-for-IntoInnerError%3CW%3E" class="impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.93.1/src/std/io/buffered/mod.rs.html#182">Source</a></span><a href="#impl-Error-for-IntoInnerError%3CW%3E" class="anchor">§</a><h3 class="code-header">impl&lt;W&gt; <a class="trait" href="../de/trait.StdError.html" title="trait serde::de::StdError">Error</a> for <a class="struct" href="https://doc.rust-lang.org/1.93.1/std/io/buffered/struct.IntoInnerError.html" title="struct std::io::buffered::IntoInnerError">IntoInnerError</a>&lt;W&gt;<div class="where">where
W: <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section></div><script src="../../trait.impl/core/error/trait.Error.js" data-ignore-extern-crates="std,core,alloc,serde_core" async></script><script type="text/json" id="notable-traits-data">{"Source<'_>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/1.93.1/core/error/struct.Source.html\" title=\"struct core::error::Source\">Source</a>&lt;'a&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/1.93.1/core/error/struct.Source.html\" title=\"struct core::error::Source\">Source</a>&lt;'a&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = &amp;'a (dyn <a class=\"trait\" href=\"../de/trait.StdError.html\" title=\"trait serde::de::StdError\">Error</a> + 'static);</div>"}</script></section></div></main></body></html>