trait.Fail.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `Fail` trait in crate `failure`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, Fail">
  9. <title>failure::Fail - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
  14. <script src="../storage.js"></script>
  15. </head>
  16. <body class="rustdoc trait">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <p class='location'>Trait Fail</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.cause">cause</a><a href="#method.backtrace">backtrace</a><a href="#method.context">context</a><a href="#method.compat">compat</a><a href="#method.causes">causes</a><a href="#method.root_cause">root_cause</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.downcast_ref">downcast_ref</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.root_cause">root_cause</a><a href="#method.causes">causes</a></div></div><p class='location'><a href='index.html'>failure</a></p><script>window.sidebarCurrent = {name: 'Fail', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>failure</a>::<wbr><a class="trait" href=''>Fail</a></span><span class='out-of-band'><span id='render-detail'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../src/failure/lib.rs.html#86-162' title='goto source code'>[src]</a></span></h1>
  50. <pre class='rust trait'>pub trait Fail: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static {
  51. fn <a href='#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>&gt; { ... }
  52. <div class='item-spacer'></div> fn <a href='#method.backtrace' class='fnname'>backtrace</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../failure/struct.Backtrace.html" title="struct failure::Backtrace">Backtrace</a>&gt; { ... }
  53. <div class='item-spacer'></div> fn <a href='#method.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
  54. { ... }
  55. <div class='item-spacer'></div> fn <a href='#method.compat' class='fnname'>compat</a>(self) -&gt; <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;Self&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
  56. { ... }
  57. <div class='item-spacer'></div> fn <a href='#method.causes' class='fnname'>causes</a>(&amp;self) -&gt; <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
  58. { ... }
  59. <div class='item-spacer'></div> fn <a href='#method.root_cause' class='fnname'>root_cause</a>(&amp;self) -&gt; &amp;<a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
  60. { ... }
  61. }</pre><div class='docblock'><p>The <code>Fail</code> trait.</p>
  62. <p>Implementors of this trait are called 'failures'.</p>
  63. <p>All error types should implement <code>Fail</code>, which provides a baseline of
  64. functionality that they all share.</p>
  65. <p><code>Fail</code> has no required methods, but it does require that your type
  66. implement several other traits:</p>
  67. <ul>
  68. <li><code>Display</code>: to print a user-friendly representation of the error.</li>
  69. <li><code>Debug</code>: to print a verbose, developer-focused representation of the
  70. error.</li>
  71. <li><code>Send + Sync</code>: Your error type is required to be safe to transfer to and
  72. reference from another thread</li>
  73. </ul>
  74. <p>Additionally, all failures must be <code>'static</code>. This enables downcasting.</p>
  75. <p><code>Fail</code> provides several methods with default implementations. Two of these
  76. may be appropriate to override depending on the definition of your
  77. particular failure: the <code>cause</code> and <code>backtrace</code> methods.</p>
  78. <p>The <code>failure_derive</code> crate provides a way to derive the <code>Fail</code> trait for
  79. your type. Additionally, all types that already implement
  80. <code>std::error::Error</code>, and are also <code>Send</code>, <code>Sync</code>, and <code>'static</code>, implement
  81. <code>Fail</code> by a blanket impl.</p>
  82. </div>
  83. <h2 id='provided-methods' class='small-section-header'>
  84. Provided Methods<a href='#provided-methods' class='anchor'></a>
  85. </h2>
  86. <div class='methods'>
  87. <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="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>&gt;</code></span></h3><div class='docblock'><p>Returns a reference to the underlying cause of this failure, if it
  88. is an error that wraps other errors.</p>
  89. <p>Returns <code>None</code> if this failure does not have another error as its
  90. underlying cause. By default, this returns <code>None</code>.</p>
  91. <p>This should <strong>never</strong> return a reference to <code>self</code>, but only return
  92. <code>Some</code> when it can return a <strong>different</strong> failure. Users may loop
  93. over the cause chain, and returning <code>self</code> would result in an infinite
  94. loop.</p>
  95. </div><h3 id='method.backtrace' class='method'><span id='backtrace.v' class='invisible'><code>fn <a href='#method.backtrace' class='fnname'>backtrace</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../failure/struct.Backtrace.html" title="struct failure::Backtrace">Backtrace</a>&gt;</code></span></h3><div class='docblock'><p>Returns a reference to the <code>Backtrace</code> carried by this failure, if it
  96. carries one.</p>
  97. <p>Returns <code>None</code> if this failure does not carry a backtrace. By
  98. default, this returns <code>None</code>.</p>
  99. </div><h3 id='method.context' class='method'><span id='context.v' class='invisible'><code>fn <a href='#method.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Provides context for this failure.</p>
  100. <p>This can provide additional information about this error, appropriate
  101. to the semantics of the current layer. That is, if you have a
  102. lower-level error, such as an IO error, you can provide additional context
  103. about what that error means in the context of your function. This
  104. gives users of this function more information about what has gone
  105. wrong.</p>
  106. <p>This takes any type that implements <code>Display</code>, as well as
  107. <code>Send</code>/<code>Sync</code>/<code>'static</code>. In practice, this means it can take a <code>String</code>
  108. or a string literal, or another failure, or some other custom context-carrying
  109. type.</p>
  110. </div><h3 id='method.compat' class='method'><span id='compat.v' class='invisible'><code>fn <a href='#method.compat' class='fnname'>compat</a>(self) -&gt; <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Wraps this failure in a compatibility wrapper that implements
  111. <code>std::error::Error</code>.</p>
  112. <p>This allows failures to be compatible with older crates that
  113. expect types that implement the <code>Error</code> trait from <code>std::error</code>.</p>
  114. </div><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'f&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'f <a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>;</span></code></div></div><h3 id='method.causes' class='method'><span id='causes.v' class='invisible'><code>fn <a href='#method.causes' class='fnname'>causes</a>(&amp;self) -&gt; <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Returns a iterator over the causes of this <code>Fail</code> with itself
  115. as the first item and the <code>root_cause</code> as the final item.</p>
  116. </div><h3 id='method.root_cause' class='method'><span id='root_cause.v' class='invisible'><code>fn <a href='#method.root_cause' class='fnname'>root_cause</a>(&amp;self) -&gt; &amp;<a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code></span></h3><div class='docblock'><p>Returns the &quot;root cause&quot; of this <code>Fail</code> - the last value in the
  117. cause chain which does not return an underlying <code>cause</code>.</p>
  118. <p>If this type does not have a cause, <code>self</code> is returned, because
  119. it is its own root cause.</p>
  120. </div></div>
  121. <h2 id='methods' class='small-section-header'>
  122. Methods<a href='#methods' class='anchor'></a>
  123. </h2>
  124. <h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/lib.rs.html#164-203' title='goto source code'>[src]</a></span></h3>
  125. <div class='impl-items'><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="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/lib.rs.html#168-174' title='goto source code'>[src]</a></span></h4>
  126. <div class='docblock'><p>Attempts to downcast this failure to a concrete type by reference.</p>
  127. <p>If the underlying error is not of type <code>T</code>, this will return <code>None</code>.</p>
  128. </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="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>&gt;(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/lib.rs.html#180-186' title='goto source code'>[src]</a></span></h4>
  129. <div class='docblock'><p>Attempts to downcast this failure to a concrete type by mutable
  130. reference.</p>
  131. <p>If the underlying error is not of type <code>T</code>, this will return <code>None</code>.</p>
  132. </div><h4 id='method.root_cause-1' class="method"><span id='root_cause.v-1' class='invisible'><code>pub fn <a href='#method.root_cause-1' class='fnname'>root_cause</a>(&amp;self) -&gt; &amp;<a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/lib.rs.html#194-196' title='goto source code'>[src]</a></span></h4>
  133. <div class='docblock'><p>Returns the &quot;root cause&quot; of this <code>Fail</code> - the last value in the
  134. cause chain which does not return an underlying <code>cause</code>.</p>
  135. <p>If this type does not have a cause, <code>self</code> is returned, because
  136. it is its own root cause.</p>
  137. </div><h4 id='method.causes-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'f&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a>&lt;'f&gt;</span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'f <a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>;</span></code></div></div><span id='causes.v-1' class='invisible'><code>pub fn <a href='#method.causes-1' class='fnname'>causes</a>(&amp;self) -&gt; <a class="struct" href="../failure/struct.Causes.html" title="struct failure::Causes">Causes</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/lib.rs.html#200-202' title='goto source code'>[src]</a></span></h4>
  138. <div class='docblock'><p>Returns a iterator over the causes of this <code>Fail</code> with itself
  139. as the first item and the <code>root_cause</code> as the final item.</p>
  140. </div></div>
  141. <h2 id='implementors' class='small-section-header'>
  142. Implementors<a href='#implementors' class='anchor'></a>
  143. </h2>
  144. <ul class='item-list' id='implementors-list'>
  145. <li><div class='out-of-band'><a class='srclink' href='../src/failure/context.rs.html#83-91' title='goto source code'>[src]</a></div><code>impl&lt;D:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static&gt; Fail for <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;</code></li>
  146. <li><div class='out-of-band'><a class='srclink' href='../src/failure/sync_failure.rs.html#97' title='goto source code'>[src]</a></div><code>impl&lt;E:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static&gt; Fail for <a class="struct" href="../failure/struct.SyncFailure.html" title="struct failure::SyncFailure">SyncFailure</a>&lt;E&gt;</code></li>
  147. <li><div class='out-of-band'><a class='srclink' href='../src/failure/lib.rs.html#206' title='goto source code'>[src]</a></div><code>impl&lt;E:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static&gt; Fail for E</code></li>
  148. </ul><script type="text/javascript" async
  149. src="../implementors/failure/trait.Fail.js">
  150. </script></section>
  151. <section id='search' class="content hidden"></section>
  152. <section class="footer"></section>
  153. <aside id="help" class="hidden">
  154. <div>
  155. <h1 class="hidden">Help</h1>
  156. <div class="shortcuts">
  157. <h2>Keyboard Shortcuts</h2>
  158. <dl>
  159. <dt><kbd>?</kbd></dt>
  160. <dd>Show this help dialog</dd>
  161. <dt><kbd>S</kbd></dt>
  162. <dd>Focus the search field</dd>
  163. <dt><kbd>↑</kbd></dt>
  164. <dd>Move up in search results</dd>
  165. <dt><kbd>↓</kbd></dt>
  166. <dd>Move down in search results</dd>
  167. <dt><kbd>↹</kbd></dt>
  168. <dd>Switch tab</dd>
  169. <dt><kbd>&#9166;</kbd></dt>
  170. <dd>Go to active search result</dd>
  171. <dt><kbd>+</kbd></dt>
  172. <dd>Expand all sections</dd>
  173. <dt><kbd>-</kbd></dt>
  174. <dd>Collapse all sections</dd>
  175. </dl>
  176. </div>
  177. <div class="infos">
  178. <h2>Search Tricks</h2>
  179. <p>
  180. Prefix searches with a type followed by a colon (e.g.
  181. <code>fn:</code>) to restrict the search to a given type.
  182. </p>
  183. <p>
  184. Accepted types are: <code>fn</code>, <code>mod</code>,
  185. <code>struct</code>, <code>enum</code>,
  186. <code>trait</code>, <code>type</code>, <code>macro</code>,
  187. and <code>const</code>.
  188. </p>
  189. <p>
  190. Search functions by type signature (e.g.
  191. <code>vec -> usize</code> or <code>* -> vec</code>)
  192. </p>
  193. </div>
  194. </div>
  195. </aside>
  196. <script>
  197. window.rootPath = "../";
  198. window.currentCrate = "failure";
  199. </script>
  200. <script src="../main.js"></script>
  201. <script defer src="../search-index.js"></script>
  202. </body>
  203. </html>