Files
mercator_service/nom/lib/std/fmt/struct.DebugMap.html

145 lines
37 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 `DebugMap` struct in crate `nom`."><meta name="keywords" content="rust, rustlang, rust-lang, DebugMap"><title>nom::lib::std::fmt::DebugMap - 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="../../../../light.css" id="themeStyle"><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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='../../../../nom/index.html'><div class='logo-container'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct DebugMap</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.entries">entries</a><a href="#method.entry">entry</a><a href="#method.finish">finish</a><a href="#method.key">key</a><a href="#method.value">value</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='../../../index.html'>nom</a>::<wbr><a href='../../index.html'>lib</a>::<wbr><a href='../index.html'>std</a>::<wbr><a href='index.html'>fmt</a></p><script>window.sidebarCurrent = {name: 'DebugMap', ty: 'struct', 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"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.2.0'>1.2.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='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#725-732' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../../../index.html'>nom</a>::<wbr><a href='../../index.html'>lib</a>::<wbr><a href='../index.html'>std</a>::<wbr><a href='index.html'>fmt</a>::<wbr><a class="struct" href=''>DebugMap</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'><span class="docblock attributes top-attr">#[must_use = "must eventually call `finish()` on Debug builders"]
</span>pub struct DebugMap&lt;'a, 'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;'b: 'a,&nbsp;</span> { /* fields omitted */ }</pre></div><div class='docblock'><p>A struct to help with <a href="trait.Debug.html"><code>fmt::Debug</code></a> implementations.</p>
<p>This is useful when you wish to output a formatted map as a part of your
<a href="trait.Debug.html#tymethod.fmt"><code>Debug::fmt</code></a> implementation.</p>
<p>This can be constructed by the
<a href="struct.Formatter.html#method.debug_map"><code>Formatter::debug_map</code></a>
method.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>().<span class="ident">entries</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="kw-2">&amp;</span>(<span class="kw-2">ref</span> <span class="ident">k</span>, <span class="kw-2">ref</span> <span class="ident">v</span>)<span class="op">|</span> (<span class="ident">k</span>, <span class="ident">v</span>))).<span class="ident">finish</span>()
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;A\&quot;: 10, \&quot;B\&quot;: 11}&quot;</span>,
);</pre></div>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;'b: 'a,&nbsp;</span></code><a href='#impl' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#739-960' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.entry' class="method"><code id='entry.v'>pub fn <a href='#method.entry' class='fnname'>entry</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;key: &amp;dyn <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;value: &amp;dyn <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a><br>) -&gt; &amp;mut <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#763-765' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds a new entry to the map output.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>()
.<span class="ident">entry</span>(<span class="kw-2">&amp;</span><span class="string">&quot;whole&quot;</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>) <span class="comment">// We add the &quot;whole&quot; entry.</span>
.<span class="ident">finish</span>()
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;whole\&quot;: [(\&quot;A\&quot;, 10), (\&quot;B\&quot;, 11)]}&quot;</span>,
);</pre></div>
</div><h4 id='method.key' class="method"><code id='key.v'>pub fn <a href='#method.key' class='fnname'>key</a>(&amp;mut self, key: &amp;dyn <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a>) -&gt; &amp;mut <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><span class='since' title='Stable since Rust version 1.42.0'>1.42.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#799-829' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds the key part of a new entry to the map output.</p>
<p>This method, together with <code>value</code>, is an alternative to <code>entry</code> that
can be used when the complete entry isn't known upfront. Prefer the <code>entry</code>
method when it's possible to use.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p><code>key</code> must be called before <code>value</code> and each call to <code>key</code> must be followed
by a corresponding call to <code>value</code>. Otherwise this method will panic.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>()
.<span class="ident">key</span>(<span class="kw-2">&amp;</span><span class="string">&quot;whole&quot;</span>).<span class="ident">value</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>) <span class="comment">// We add the &quot;whole&quot; entry.</span>
.<span class="ident">finish</span>()
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;whole\&quot;: [(\&quot;A\&quot;, 10), (\&quot;B\&quot;, 11)]}&quot;</span>,
);</pre></div>
</div><h4 id='method.value' class="method"><code id='value.v'>pub fn <a href='#method.value' class='fnname'>value</a>(&amp;mut self, value: &amp;dyn <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a>) -&gt; &amp;mut <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><span class='since' title='Stable since Rust version 1.42.0'>1.42.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#863-882' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds the value part of a new entry to the map output.</p>
<p>This method, together with <code>key</code>, is an alternative to <code>entry</code> that
can be used when the complete entry isn't known upfront. Prefer the <code>entry</code>
method when it's possible to use.</p>
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
<p><code>key</code> must be called before <code>value</code> and each call to <code>key</code> must be followed
by a corresponding call to <code>value</code>. Otherwise this method will panic.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>()
.<span class="ident">key</span>(<span class="kw-2">&amp;</span><span class="string">&quot;whole&quot;</span>).<span class="ident">value</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>) <span class="comment">// We add the &quot;whole&quot; entry.</span>
.<span class="ident">finish</span>()
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;whole\&quot;: [(\&quot;A\&quot;, 10), (\&quot;B\&quot;, 11)]}&quot;</span>,
);</pre></div>
</div><h4 id='method.entries' class="method"><code id='entries.v'>pub fn <a href='#method.entries' class='fnname'>entries</a>&lt;K, V, I&gt;(&amp;mut self, entries: I) -&gt; &amp;mut <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.IntoIterator.html" title="trait nom::lib::std::prelude::v1::v1::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>K, V<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class="trait" href="../../../../nom/lib/std/fmt/trait.Debug.html" title="trait nom::lib::std::fmt::Debug">Debug</a>,&nbsp;</span></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#909-919' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds the contents of an iterator of entries to the map output.</p>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>()
<span class="comment">// We map our vec so each entries&#39; first field will become</span>
<span class="comment">// the &quot;key&quot;.</span>
.<span class="ident">entries</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="kw-2">&amp;</span>(<span class="kw-2">ref</span> <span class="ident">k</span>, <span class="kw-2">ref</span> <span class="ident">v</span>)<span class="op">|</span> (<span class="ident">k</span>, <span class="ident">v</span>)))
.<span class="ident">finish</span>()
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;A\&quot;: 10, \&quot;B\&quot;: 11}&quot;</span>,
);</pre></div>
</div><h4 id='method.finish' class="method"><code id='finish.v'>pub fn <a href='#method.finish' class='fnname'>finish</a>(&amp;mut self) -&gt; <a class="enum" href="../../../../nom/lib/std/prelude/v1/v1/enum.Result.html" title="enum nom::lib::std::prelude::v1::v1::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="../../../../nom/lib/std/fmt/struct.Error.html" title="struct nom::lib::std::fmt::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/fmt/builders.rs.html#949-955' title='goto source code'>[src]</a></h4><div class='docblock'><p>Finishes output and returns any error encountered.</p>
<h1 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h1>
<p><code>key</code> must be called before <code>value</code> and each call to <code>key</code> must be followed
by a corresponding call to <code>value</code>. Otherwise this method will panic.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
<span class="kw">struct</span> <span class="ident">Foo</span>(<span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">String</span>, <span class="ident">i32</span>)<span class="op">&gt;</span>);
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">Foo</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">fmt</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">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="ident">fmt</span>.<span class="ident">debug_map</span>()
.<span class="ident">entries</span>(<span class="self">self</span>.<span class="number">0</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="kw-2">&amp;</span>(<span class="kw-2">ref</span> <span class="ident">k</span>, <span class="kw-2">ref</span> <span class="ident">v</span>)<span class="op">|</span> (<span class="ident">k</span>, <span class="ident">v</span>)))
.<span class="ident">finish</span>() <span class="comment">// Ends the struct formatting.</span>
}
}
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Foo</span>(<span class="macro">vec</span><span class="macro">!</span>[(<span class="string">&quot;A&quot;</span>.<span class="ident">to_string</span>(), <span class="number">10</span>), (<span class="string">&quot;B&quot;</span>.<span class="ident">to_string</span>(), <span class="number">11</span>)])),
<span class="string">&quot;{\&quot;A\&quot;: 10, \&quot;B\&quot;: 11}&quot;</span>,
);</pre></div>
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; !<a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Send.html" title="trait nom::lib::std::prelude::v1::v1::Send">Send</a> for <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; !<a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Sync.html" title="trait nom::lib::std::prelude::v1::v1::Sync">Sync</a> for <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Unpin.html" title="trait nom::lib::std::prelude::v1::v1::Unpin">Unpin</a> for <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;'b: 'a,&nbsp;</span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../../nom/lib/std/fmt/struct.DebugMap.html" title="struct nom::lib::std::fmt::DebugMap">DebugMap</a>&lt;'a, 'b&gt;</code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Sized.html" title="trait nom::lib::std::prelude::v1::v1::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Sized.html" title="trait nom::lib::std::prelude::v1::v1::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Sized.html" title="trait nom::lib::std::prelude::v1::v1::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.From.html" title="trait nom::lib::std::prelude::v1::v1::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#564-568' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='../../../../nom/lib/std/prelude/v1/v1/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-567' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Into.html" title="trait nom::lib::std::prelude::v1::v1::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.From.html" title="trait nom::lib::std::prelude::v1::v1::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='../../../../nom/lib/std/prelude/v1/v1/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../../../nom/lib/std/convert/trait.TryFrom.html" title="trait nom::lib::std::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../../../nom/lib/std/prelude/v1/v1/trait.Into.html" title="trait nom::lib::std::prelude::v1::v1::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#601-610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../../../../nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../../../nom/lib/std/convert/enum.Infallible.html" title="enum nom::lib::std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='../../../../nom/lib/std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="../../../../nom/lib/std/prelude/v1/v1/enum.Result.html" title="enum nom::lib::std::prelude::v1::v1::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="../../../../nom/lib/std/convert/trait.TryFrom.html" title="trait nom::lib::std::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="../../../../nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error" title="type nom::lib::std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-609' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../../../nom/lib/std/convert/trait.TryInto.html" title="trait nom::lib::std::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../../../nom/lib/std/convert/trait.TryFrom.html" title="trait nom::lib::std::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#587-596' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../../../../nom/lib/std/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="../../../../nom/lib/std/convert/trait.TryFrom.html" title="trait nom::lib::std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../../../nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error" title="type nom::lib::std::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../../../../nom/lib/std/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="../../../../nom/lib/std/prelude/v1/v1/enum.Result.html" title="enum nom::lib::std::prelude::v1::v1::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="../../../../nom/lib/std/convert/trait.TryFrom.html" title="trait nom::lib::std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../../../nom/lib/std/convert/trait.TryFrom.html#associatedtype.Error" title="type nom::lib::std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-595' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "nom";</script><script src="../../../../aliases.js"></script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>