mentat/failure/trait.ResultExt.html
2018-08-22 17:04:13 +00:00

216 lines
No EOL
24 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="API documentation for the Rust `ResultExt` trait in crate `failure`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ResultExt">
<title>failure::ResultExt - 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>
</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>
<p class='location'>Trait ResultExt</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.compat">compat</a><a href="#tymethod.context">context</a><a href="#tymethod.with_context">with_context</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-ResultExt%3CT%2C%20E%3E">Result&lt;T, E&gt;</a><a href="#impl-ResultExt%3CT%2C%20Error%3E">Result&lt;T, Error&gt;</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>failure</a></p><script>window.sidebarCurrent = {name: 'ResultExt', 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'>failure</a>::<wbr><a class="trait" href=''>ResultExt</a></span><span class='out-of-band'><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/failure/result_ext.rs.html#6-150' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait ResultExt&lt;T, E&gt; {
fn <a href='#tymethod.compat' class='fnname'>compat</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;E&gt;&gt;;
<div class='item-spacer'></div> fn <a href='#tymethod.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&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</span>;
<div class='item-spacer'></div> fn <a href='#tymethod.with_context' class='fnname'>with_context</a>&lt;F, D&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>E) -&gt; D,<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</span>;
}</pre><div class='docblock'><p>Extension methods for <code>Result</code>.</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.compat' class='method'><span id='compat.v' class='invisible'><code>fn <a href='#tymethod.compat' class='fnname'>compat</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;E&gt;&gt;</code></span></h3><div class='docblock'><p>Wraps the error in <code>Compat</code> to make it compatible with older error
handling APIs that expect <code>std::error::Error</code>.</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">struct</span> <span class="ident">CustomError</span>;
<span class="kw">impl</span> <span class="ident">Error</span> <span class="kw">for</span> <span class="ident">CustomError</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;My custom error message&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">None</span>
}
}
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> (<span class="op">||</span> <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">failure</span>::<span class="ident">Error</span><span class="op">&gt;</span> {
<span class="prelude-val">Err</span>(<span class="ident">CustomError</span>).<span class="ident">compat</span>()<span class="question-mark">?</span>
})().<span class="ident">with_context</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> {
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;An error occured: {}&quot;</span>, <span class="ident">e</span>)
}).<span class="ident">unwrap_err</span>();
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">x</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>, <span class="string">&quot;An error occured: My custom error message&quot;</span>);
</pre>
</div><h3 id='tymethod.context' class='method'><span id='context.v' class='invisible'><code>fn <a href='#tymethod.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&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,&nbsp;</span></code></span></h3><div class='docblock'><p>Wraps the error type in a context type.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Fail</span>, <span class="ident">Debug</span>)]</span>
<span class="attribute">#[<span class="ident">fail</span>(<span class="ident">display</span> <span class="op">=</span> <span class="string">&quot;&quot;</span>)]</span>
<span class="kw">struct</span> <span class="ident">CustomError</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> (<span class="op">||</span> <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">failure</span>::<span class="ident">Error</span><span class="op">&gt;</span> {
<span class="prelude-val">Err</span>(<span class="ident">CustomError</span>)<span class="question-mark">?</span>
})().<span class="ident">context</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;An error occured&quot;</span>)).<span class="ident">unwrap_err</span>();
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">x</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>, <span class="string">&quot;An error occured&quot;</span>);
</pre>
</div><h3 id='tymethod.with_context' class='method'><span id='with_context.v' class='invisible'><code>fn <a href='#tymethod.with_context' class='fnname'>with_context</a>&lt;F, D&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>E) -&gt; D,<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,&nbsp;</span></code></span></h3><div class='docblock'><p>Wraps the error type in a context type generated by looking at the
error value.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<pre class="rust rust-example-rendered">
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Fail</span>, <span class="ident">Debug</span>)]</span>
<span class="attribute">#[<span class="ident">fail</span>(<span class="ident">display</span> <span class="op">=</span> <span class="string">&quot;My custom error message&quot;</span>)]</span>
<span class="kw">struct</span> <span class="ident">CustomError</span>;
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> (<span class="op">||</span> <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(), <span class="ident">failure</span>::<span class="ident">Error</span><span class="op">&gt;</span> {
<span class="prelude-val">Err</span>(<span class="ident">CustomError</span>)<span class="question-mark">?</span>
})().<span class="ident">with_context</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> {
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;An error occured: {}&quot;</span>, <span class="ident">e</span>)
}).<span class="ident">unwrap_err</span>();
<span class="kw">let</span> <span class="ident">x</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">x</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">x</span>, <span class="string">&quot;An error occured: My custom error message&quot;</span>);
</pre>
</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-ResultExt%3CT%2C%20E%3E' class='impl'><span class='in-band'><code>impl&lt;T, E&gt; <a class="trait" href="../failure/trait.ResultExt.html" title="trait failure::ResultExt">ResultExt</a>&lt;T, E&gt; for <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="../failure/trait.Fail.html" title="trait failure::Fail">Fail</a>,&nbsp;</span></code><a href='#impl-ResultExt%3CT%2C%20E%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#152-177' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='method.compat' class="method"><span id='compat.v-1' class='invisible'><code>fn <a href='#method.compat' class='fnname'>compat</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;E&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#156-158' title='goto source code'>[src]</a></span></h4>
<h4 id='method.context' class="method"><span id='context.v-1' class='invisible'><code>fn <a href='#method.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&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,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#160-165' title='goto source code'>[src]</a></span></h4>
<h4 id='method.with_context' class="method"><span id='with_context.v-1' class='invisible'><code>fn <a href='#method.with_context' class='fnname'>with_context</a>&lt;F, D&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>E) -&gt; D,<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,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#167-176' title='goto source code'>[src]</a></span></h4>
</div></span><h3 id='impl-ResultExt%3CT%2C%20Error%3E' class='impl'><span class='in-band'><code>impl&lt;T&gt; <a class="trait" href="../failure/trait.ResultExt.html" title="trait failure::ResultExt">ResultExt</a>&lt;T, <a class="struct" href="../failure/struct.Error.html" title="struct failure::Error">Error</a>&gt; for <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Error.html" title="struct failure::Error">Error</a>&gt;</code><a href='#impl-ResultExt%3CT%2C%20Error%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#182-202' title='goto source code'>[src]</a></span></h3>
<span class='docblock autohide'><div class='impl-items'><h4 id='method.compat-1' class="method"><span id='compat.v-2' class='invisible'><code>fn <a href='#method.compat' class='fnname'>compat</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Compat.html" title="struct failure::Compat">Compat</a>&lt;<a class="struct" href="../failure/struct.Error.html" title="struct failure::Error">Error</a>&gt;&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#183-185' title='goto source code'>[src]</a></span></h4>
<h4 id='method.context-1' class="method"><span id='context.v-2' class='invisible'><code>fn <a href='#method.context' class='fnname'>context</a>&lt;D&gt;(self, context: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&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,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#187-191' title='goto source code'>[src]</a></span></h4>
<h4 id='method.with_context-1' class="method"><span id='with_context.v-2' class='invisible'><code>fn <a href='#method.with_context' class='fnname'>with_context</a>&lt;F, D&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../failure/struct.Context.html" title="struct failure::Context">Context</a>&lt;D&gt;&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&amp;<a class="struct" href="../failure/struct.Error.html" title="struct failure::Error">Error</a>) -&gt; D,<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,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/failure/result_ext.rs.html#193-201' 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'>
</ul><script type="text/javascript" async
src="../implementors/failure/trait.ResultExt.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 = "failure";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>