Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > fdedb3cf2140df9b6d419a2338ab1caa > files > 3892

rust-doc-1.25.0-1.mga6.x86_64.rpm

<!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="API documentation for the Rust `Error` trait in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, Error">

    <title>std::error::Error - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
    
    <link rel="stylesheet" type="text/css" href="../../dark.css">
    <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
    <script src="../../storage.js"></script>
    

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</head>
<body class="rustdoc trait">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        <div class="sidebar-menu">&#9776;</div>
        <a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
        <p class='location'>Trait Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.description">description</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.cause">cause</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-Error">TryFromSliceError</a></div><a class="sidebar-title" href="#implementors">Implementors</a><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.is">is</a><a href="#method.downcast_ref">downcast_ref</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.is">is</a><a href="#method.downcast_ref">downcast_ref</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.is">is</a><a href="#method.downcast_ref">downcast_ref</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.downcast">downcast</a><a href="#method.downcast">downcast</a><a href="#method.downcast">downcast</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>error</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
    </nav>

    <div class="theme-picker">
        <button id="theme-picker" aria-label="Pick another theme!">
            <img src="../../brush.svg" width="18" alt="Pick another theme!">
        </button>
        <div id="theme-choices"></div>
    </div>
    <script src="../../theme.js"></script>
    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>std</a>::<wbr><a href='index.html'>error</a>::<wbr><a class="trait" href=''>Error</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'>
                   <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                       [<span class='inner'>&#x2212;</span>]
                   </a>
               </span><a class='srclink' href='../../src/std/error.rs.html#69-164' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait Error: <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> + <a class="trait" href="../../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> {
    fn <a href='#tymethod.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="../primitive.str.html">str</a>;

    fn <a href='#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt; { ... }
}</pre><div class='docblock'><p>Base functionality for all errors in Rust.</p>
</div>
            <h2 id='required-methods' class='small-section-header'>
              Required Methods<a href='#required-methods' class='anchor'></a>
            </h2>
            <div class='methods'>
        <h3 id='tymethod.description' class='method'><span id='description.v' class='invisible'><code>fn <a href='#tymethod.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="../primitive.str.html">str</a></code></span></h3><div class='docblock'><p>A short description of the error.</p>
<p>The description should only be used for a simple message.
It should not contain newlines or sentence-ending punctuation,
to facilitate embedding in larger user-facing strings.
For showing formatted error messages with more information see
<a href="../fmt/trait.Display.html"><code>Display</code></a>.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span>;

<span class="kw">match</span> <span class="string">&quot;xc&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u32</span><span class="op">&gt;</span>() {
    <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> {
        <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Error: {}&quot;</span>, <span class="ident">e</span>.<span class="ident">description</span>());
    }
    _ <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;No error&quot;</span>),
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Aerror%3A%3AError%3B%0A%0Amatch%20%22xc%22.parse%3A%3A%3Cu32%3E()%20%7B%0A%20%20%20%20Err(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20println!(%22Error%3A%20%7B%7D%22%2C%20e.description())%3B%0A%20%20%20%20%7D%0A%20%20%20%20_%20%3D%3E%20println!(%22No%20error%22)%2C%0A%7D%0A%7D">Run</a></pre>
</div></div>
            <h2 id='provided-methods' class='small-section-header'>
              Provided Methods<a href='#provided-methods' class='anchor'></a>
            </h2>
            <div class='methods'>
        <h3 id='method.cause' class='method'><span id='cause.v' class='invisible'><code>fn <a href='#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;</code></span></h3><div class='docblock'><p>The lower-level cause of this error, if any.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">error</span>::<span class="ident">Error</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;

<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
<span class="kw">struct</span> <span class="ident">SuperError</span> {
    <span class="ident">side</span>: <span class="ident">SuperErrorSideKick</span>,
}

<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">SuperError</span> {
    <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
        <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;SuperError is here!&quot;</span>)
    }
}

<span class="kw">impl</span> <span class="ident">Error</span> <span class="kw">for</span> <span class="ident">SuperError</span> {
    <span class="kw">fn</span> <span class="ident">description</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="kw-2">&amp;</span><span class="ident">str</span> {
        <span class="string">&quot;I&#39;m the superhero of errors&quot;</span>
    }

    <span class="kw">fn</span> <span class="ident">cause</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">Error</span><span class="op">&gt;</span> {
        <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">side</span>)
    }
}

<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
<span class="kw">struct</span> <span class="ident">SuperErrorSideKick</span>;

<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">SuperErrorSideKick</span> {
    <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
        <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;SuperErrorSideKick is here!&quot;</span>)
    }
}

<span class="kw">impl</span> <span class="ident">Error</span> <span class="kw">for</span> <span class="ident">SuperErrorSideKick</span> {
    <span class="kw">fn</span> <span class="ident">description</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="kw-2">&amp;</span><span class="ident">str</span> {
        <span class="string">&quot;I&#39;m SuperError side kick&quot;</span>
    }
}

<span class="kw">fn</span> <span class="ident">get_super_error</span>() <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">SuperError</span><span class="op">&gt;</span> {
    <span class="prelude-val">Err</span>(<span class="ident">SuperError</span> { <span class="ident">side</span>: <span class="ident">SuperErrorSideKick</span> })
}

<span class="kw">fn</span> <span class="ident">main</span>() {
    <span class="kw">match</span> <span class="ident">get_super_error</span>() {
        <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=&gt;</span> {
            <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Error: {}&quot;</span>, <span class="ident">e</span>.<span class="ident">description</span>());
            <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Caused by: {}&quot;</span>, <span class="ident">e</span>.<span class="ident">cause</span>().<span class="ident">unwrap</span>());
        }
        _ <span class="op">=&gt;</span> <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;No error&quot;</span>),
    }
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Ause%20std%3A%3Aerror%3A%3AError%3B%0Ause%20std%3A%3Afmt%3B%0A%0A%23%5Bderive(Debug)%5D%0Astruct%20SuperError%20%7B%0A%20%20%20%20side%3A%20SuperErrorSideKick%2C%0A%7D%0A%0Aimpl%20fmt%3A%3ADisplay%20for%20SuperError%20%7B%0A%20%20%20%20fn%20fmt(%26self%2C%20f%3A%20%26mut%20fmt%3A%3AFormatter)%20-%3E%20fmt%3A%3AResult%20%7B%0A%20%20%20%20%20%20%20%20write!(f%2C%20%22SuperError%20is%20here!%22)%0A%20%20%20%20%7D%0A%7D%0A%0Aimpl%20Error%20for%20SuperError%20%7B%0A%20%20%20%20fn%20description(%26self)%20-%3E%20%26str%20%7B%0A%20%20%20%20%20%20%20%20%22I'm%20the%20superhero%20of%20errors%22%0A%20%20%20%20%7D%0A%0A%20%20%20%20fn%20cause(%26self)%20-%3E%20Option%3C%26Error%3E%20%7B%0A%20%20%20%20%20%20%20%20Some(%26self.side)%0A%20%20%20%20%7D%0A%7D%0A%0A%23%5Bderive(Debug)%5D%0Astruct%20SuperErrorSideKick%3B%0A%0Aimpl%20fmt%3A%3ADisplay%20for%20SuperErrorSideKick%20%7B%0A%20%20%20%20fn%20fmt(%26self%2C%20f%3A%20%26mut%20fmt%3A%3AFormatter)%20-%3E%20fmt%3A%3AResult%20%7B%0A%20%20%20%20%20%20%20%20write!(f%2C%20%22SuperErrorSideKick%20is%20here!%22)%0A%20%20%20%20%7D%0A%7D%0A%0Aimpl%20Error%20for%20SuperErrorSideKick%20%7B%0A%20%20%20%20fn%20description(%26self)%20-%3E%20%26str%20%7B%0A%20%20%20%20%20%20%20%20%22I'm%20SuperError%20side%20kick%22%0A%20%20%20%20%7D%0A%7D%0A%0Afn%20get_super_error()%20-%3E%20Result%3C()%2C%20SuperError%3E%20%7B%0A%20%20%20%20Err(SuperError%20%7B%20side%3A%20SuperErrorSideKick%20%7D)%0A%7D%0A%0Afn%20main()%20%7B%0A%20%20%20%20match%20get_super_error()%20%7B%0A%20%20%20%20%20%20%20%20Err(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20println!(%22Error%3A%20%7B%7D%22%2C%20e.description())%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20println!(%22Caused%20by%3A%20%7B%7D%22%2C%20e.cause().unwrap())%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20_%20%3D%3E%20println!(%22No%20error%22)%2C%0A%20%20%20%20%7D%0A%7D%0A">Run</a></pre>
</div></div>
                    <h2 id='methods' class='small-section-header'>
                      Methods<a href='#methods' class='anchor'></a>
                    </h2>
                <h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static</code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#383-425' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.is' class="method"><span id='is.v' class='invisible'><code>pub fn <a href='#method.is' class='fnname'>is</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#387-396' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns true if the boxed type is the same as <code>T</code></p>
</div><h4 id='method.downcast_ref' class="method"><span id='downcast_ref.v' class='invisible'><code>pub fn <a href='#method.downcast_ref' class='fnname'>downcast_ref</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;</a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#402-410' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns some reference to the boxed value if it is of type <code>T</code>, or
<code>None</code> if it isn't.</p>
</div><h4 id='method.downcast_mut' class="method"><span id='downcast_mut.v' class='invisible'><code>pub fn <a href='#method.downcast_mut' class='fnname'>downcast_mut</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;mut self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;mut </a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#416-424' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Returns some mutable reference to the boxed value if it is of type <code>T</code>, or
<code>None</code> if it isn't.</p>
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + 'static</code><a href='#impl-1' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#427-448' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.is-1' class="method"><span id='is.v-1' class='invisible'><code>pub fn <a href='#method.is-1' class='fnname'>is</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#431-433' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div><h4 id='method.downcast_ref-1' class="method"><span id='downcast_ref.v-1' class='invisible'><code>pub fn <a href='#method.downcast_ref-1' class='fnname'>downcast_ref</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;</a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#438-440' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div><h4 id='method.downcast_mut-1' class="method"><span id='downcast_mut.v-1' class='invisible'><code>pub fn <a href='#method.downcast_mut-1' class='fnname'>downcast_mut</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;mut self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;mut </a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#445-447' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div></div><h3 id='impl-2' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> + 'static</code><a href='#impl-2' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#450-471' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.is-2' class="method"><span id='is.v-2' class='invisible'><code>pub fn <a href='#method.is-2' class='fnname'>is</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#454-456' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div><h4 id='method.downcast_ref-2' class="method"><span id='downcast_ref.v-2' class='invisible'><code>pub fn <a href='#method.downcast_ref-2' class='fnname'>downcast_ref</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;</a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#461-463' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div><h4 id='method.downcast_mut-2' class="method"><span id='downcast_mut.v-2' class='invisible'><code>pub fn <a href='#method.downcast_mut-2' class='fnname'>downcast_mut</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(&amp;mut self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;mut </a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#468-470' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Forwards to the method defined on the type <code>Any</code>.</p>
</div></div><h3 id='impl-3' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a></code><a href='#impl-3' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#473-487' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.downcast' class="method"><span id='downcast.v' class='invisible'><code>pub fn <a href='#method.downcast' class='fnname'>downcast</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;Self&gt;<br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#477-486' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Attempt to downcast the box to a concrete type.</p>
</div></div><h3 id='impl-4' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a></code><a href='#impl-4' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#489-501' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.downcast-1' class="method"><span id='downcast.v-1' class='invisible'><code>pub fn <a href='#method.downcast-1' class='fnname'>downcast</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;Self&gt;<br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#493-500' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Attempt to downcast the box to a concrete type.</p>
</div></div><h3 id='impl-5' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a></code><a href='#impl-5' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#503-515' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.downcast-2' class="method"><span id='downcast.v-2' class='invisible'><code>pub fn <a href='#method.downcast-2' class='fnname'>downcast</a>&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;Self&gt;<br>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt;, <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;Self&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/std/error.rs.html#507-514' title='goto source code'>[src]</a></span></h4>
<div class='docblock'><p>Attempt to downcast the box to a concrete type.</p>
</div></div>
                <h2 id='foreign-impls' class='small-section-header'>
                  Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
                </h2>
            <h3 id='impl-Error' class='impl'><span class='in-band'><code>impl <a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="struct" href="../../core/array/struct.TryFromSliceError.html" title="struct core::array::TryFromSliceError">TryFromSliceError</a></code><a href='#impl-Error' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#287-291' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='method.description' class="method"><span id='description.v-1' class='invisible'><code>fn <a href='#method.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="../primitive.str.html">str</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/std/error.rs.html#288-290' title='goto source code'>[src]</a></span></h4>
<h4 id='method.cause-1' class="method"><span id='cause.v-1' class='invisible'><code>fn <a href='../../std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../../src/std/error.rs.html#154' title='goto source code'>[src]</a></span></h4>
</div></span>
        <h2 id='implementors' class='small-section-header'>
          Implementors<a href='#implementors' class='anchor'></a>
        </h2>
        <ul class='item-list' id='implementors-list'>
    <li><div class='out-of-band'><a class='srclink' href='../../src/std/env.rs.html#275-282' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/env/enum.VarError.html" title="enum std::env::VarError">VarError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/env.rs.html#498-500' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/env/struct.JoinPathsError.html" title="struct std::env::JoinPathsError">JoinPathsError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#238-240' title='goto source code'>[src]</a></div><code>impl Error for <a class="primitive" href="../primitive.never.html">!</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#245-249' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/heap/enum.AllocErr.html" title="enum std::heap::AllocErr">AllocErr</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#254-258' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/heap/struct.CannotReallocInPlace.html" title="struct std::heap::CannotReallocInPlace">CannotReallocInPlace</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#261-263' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/str/struct.ParseBoolError.html" title="struct std::str::ParseBoolError">ParseBoolError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#266-270' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/str/struct.Utf8Error.html" title="struct std::str::Utf8Error">Utf8Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#273-277' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/num/struct.ParseIntError.html" title="struct std::num::ParseIntError">ParseIntError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#280-284' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/num/struct.TryFromIntError.html" title="struct std::num::TryFromIntError">TryFromIntError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#294-298' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/num/struct.ParseFloatError.html" title="struct std::num::ParseFloatError">ParseFloatError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#301-305' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/string/struct.FromUtf8Error.html" title="struct std::string::FromUtf8Error">FromUtf8Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#308-312' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/string/struct.FromUtf16Error.html" title="struct std::string::FromUtf16Error">FromUtf16Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#315-319' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/string/enum.ParseError.html" title="enum std::string::ParseError">ParseError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#322-326' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/char/struct.DecodeUtf16Error.html" title="struct std::char::DecodeUtf16Error">DecodeUtf16Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#329-337' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt; Error for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#340-344' title='goto source code'>[src]</a></div><code>impl Error for std::fmt::<a class="struct" href="../../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#347-351' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/cell/struct.BorrowError.html" title="struct std::cell::BorrowError">BorrowError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#354-358' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/cell/struct.BorrowMutError.html" title="struct std::cell::BorrowMutError">BorrowMutError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#361-365' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/char/struct.CharTryFromError.html" title="struct std::char::CharTryFromError">CharTryFromError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#368-372' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/char/struct.ParseCharError.html" title="struct std::char::ParseCharError">ParseCharError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/error.rs.html#375-380' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/ffi/c_str.rs.html#789-791' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/ffi/struct.NulError.html" title="struct std::ffi::NulError">NulError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/ffi/c_str.rs.html#809-818' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/ffi/struct.FromBytesWithNulError.html" title="struct std::ffi::FromBytesWithNulError">FromBytesWithNulError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/ffi/c_str.rs.html#849-857' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/ffi/struct.IntoStringError.html" title="struct std::ffi::IntoStringError">IntoStringError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/io/buffered.rs.html#664-668' title='goto source code'>[src]</a></div><code>impl&lt;W:&nbsp;<a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a>&gt; Error for <a class="struct" href="../../std/io/struct.IntoInnerError.html" title="struct std::io::IntoInnerError">IntoInnerError</a>&lt;W&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/io/error.rs.html#546-561' title='goto source code'>[src]</a></div><code>impl Error for std::io::<a class="struct" href="../../std/io/struct.Error.html" title="struct std::io::Error">Error</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/io/mod.rs.html#2058-2071' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/io/enum.CharsError.html" title="enum std::io::CharsError">CharsError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/net/parser.rs.html#394-398' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/net/struct.AddrParseError.html" title="struct std::net::AddrParseError">AddrParseError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/path.rs.html#2616-2618' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/path/struct.StripPrefixError.html" title="struct std::path::StripPrefixError">StripPrefixError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#1636-1644' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>&gt; Error for <a class="struct" href="../../std/sync/mpsc/struct.SendError.html" title="struct std::sync::mpsc::SendError">SendError</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#1671-1687' title='goto source code'>[src]</a></div><code>impl&lt;T:&nbsp;<a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a>&gt; Error for <a class="enum" href="../../std/sync/mpsc/enum.TrySendError.html" title="enum std::sync::mpsc::TrySendError">TrySendError</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#1706-1715' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/sync/mpsc/struct.RecvError.html" title="struct std::sync::mpsc::RecvError">RecvError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#1732-1748' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/sync/mpsc/enum.TryRecvError.html" title="enum std::sync::mpsc::TryRecvError">TryRecvError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sync/mpsc/mod.rs.html#1774-1789' title='goto source code'>[src]</a></div><code>impl Error for <a class="enum" href="../../std/sync/mpsc/enum.RecvTimeoutError.html" title="enum std::sync::mpsc::RecvTimeoutError">RecvTimeoutError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/time.rs.html#430-432' title='goto source code'>[src]</a></div><code>impl Error for <a class="struct" href="../../std/time/struct.SystemTimeError.html" title="struct std::time::SystemTimeError">SystemTimeError</a></code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sys_common/poison.rs.html#162-166' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Error for <a class="struct" href="../../std/sync/struct.PoisonError.html" title="struct std::sync::PoisonError">PoisonError</a>&lt;T&gt;</code></li>
<li><div class='out-of-band'><a class='srclink' href='../../src/std/sys_common/poison.rs.html#246-260' title='goto source code'>[src]</a></div><code>impl&lt;T&gt; Error for <a class="enum" href="../../std/sync/enum.TryLockError.html" title="enum std::sync::TryLockError">TryLockError</a>&lt;T&gt;</code></li>
</ul><script type="text/javascript" async
                         src="../../implementors/std/error/trait.Error.js">
                 </script></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt><kbd>?</kbd></dt>
                    <dd>Show this help dialog</dd>
                    <dt><kbd>S</kbd></dt>
                    <dd>Focus the search field</dd>
                    <dt><kbd>↑</kbd></dt>
                    <dd>Move up in search results</dd>
                    <dt><kbd>↓</kbd></dt>
                    <dd>Move down in search results</dd>
                    <dt><kbd>↹</kbd></dt>
                    <dd>Switch tab</dd>
                    <dt><kbd>&#9166;</kbd></dt>
                    <dd>Go to active search result</dd>
                    <dt><kbd>+</kbd></dt>
                    <dd>Expand all sections</dd>
                    <dt><kbd>-</kbd></dt>
                    <dd>Collapse all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../";
        window.currentCrate = "std";
    </script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>