blob: 872274971b295655f15012f4488827fd38fe168d [file] [log] [blame]
<!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="A visitor for a `ValueBag`."><meta name="keywords" content="rust, rustlang, rust-lang, Visit"><title>Visit in value_bag::visit - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../value_bag/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../value_bag/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Visit</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.visit_any">visit_any</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.visit_bool">visit_bool</a></li><li><a href="#method.visit_borrowed_error">visit_borrowed_error</a></li><li><a href="#method.visit_borrowed_str">visit_borrowed_str</a></li><li><a href="#method.visit_char">visit_char</a></li><li><a href="#method.visit_error">visit_error</a></li><li><a href="#method.visit_f64">visit_f64</a></li><li><a href="#method.visit_i128">visit_i128</a></li><li><a href="#method.visit_i64">visit_i64</a></li><li><a href="#method.visit_str">visit_str</a></li><li><a href="#method.visit_u128">visit_u128</a></li><li><a href="#method.visit_u64">visit_u64</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Visit%3C%27v%3E-for-%26%27a%20mut%20T">&amp;&#39;a mut T</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In value_bag::visit</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">value_bag</a>::<wbr><a href="index.html">visit</a>::<wbr><a class="trait" href="#">Visit</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/value_bag/visit.rs.html#67-147">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait Visit&lt;'v&gt; {
fn <a href="#tymethod.visit_any" class="fnname">visit_any</a>(&amp;mut self, value: <a class="struct" href="../struct.ValueBag.html" title="struct value_bag::ValueBag">ValueBag</a>&lt;'_&gt;) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;;
fn <a href="#method.visit_u64" class="fnname">visit_u64</a>(&amp;mut self, value: u64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i64" class="fnname">visit_i64</a>(&amp;mut self, value: i64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u128" class="fnname">visit_u128</a>(&amp;mut self, value: u128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i128" class="fnname">visit_i128</a>(&amp;mut self, value: i128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_f64" class="fnname">visit_f64</a>(&amp;mut self, value: f64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_bool" class="fnname">visit_bool</a>(&amp;mut self, value: bool) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_str" class="fnname">visit_str</a>(&amp;mut self, value: &amp;str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_borrowed_str" class="fnname">visit_borrowed_str</a>(&amp;mut self, value: &amp;'v str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_char" class="fnname">visit_char</a>(&amp;mut self, value: char) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_error" class="fnname">visit_error</a>(&amp;mut self, err: &amp;(dyn Error + 'static)) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_borrowed_error" class="fnname">visit_borrowed_error</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;err: &amp;'v (dyn Error + 'static)<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt; { ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A visitor for a <code>ValueBag</code>.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.visit_any" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#74">source</a><h4 class="code-header">fn <a href="#tymethod.visit_any" class="fnname">visit_any</a>(&amp;mut self, value: <a class="struct" href="../struct.ValueBag.html" title="struct value_bag::ValueBag">ValueBag</a>&lt;'_&gt;) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a <code>ValueBag</code>.</p>
<p>This is the only required method on <code>Visit</code> and acts as a fallback for any
more specific methods that aren’t overridden.
The <code>ValueBag</code> may be formatted using its <code>fmt::Debug</code> or <code>fmt::Display</code> implementation,
or serialized using its <code>sval::Value</code> or <code>serde::Serialize</code> implementation.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_u64" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#78-80">source</a><h4 class="code-header">fn <a href="#method.visit_u64" class="fnname">visit_u64</a>(&amp;mut self, value: u64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit an unsigned integer.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_i64" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#84-86">source</a><h4 class="code-header">fn <a href="#method.visit_i64" class="fnname">visit_i64</a>(&amp;mut self, value: i64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a signed integer.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_u128" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#90-92">source</a><h4 class="code-header">fn <a href="#method.visit_u128" class="fnname">visit_u128</a>(&amp;mut self, value: u128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a big unsigned integer.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_i128" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#96-98">source</a><h4 class="code-header">fn <a href="#method.visit_i128" class="fnname">visit_i128</a>(&amp;mut self, value: i128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a big signed integer.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_f64" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#102-104">source</a><h4 class="code-header">fn <a href="#method.visit_f64" class="fnname">visit_f64</a>(&amp;mut self, value: f64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a floating point.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_bool" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#108-110">source</a><h4 class="code-header">fn <a href="#method.visit_bool" class="fnname">visit_bool</a>(&amp;mut self, value: bool) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a boolean.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_str" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#114-116">source</a><h4 class="code-header">fn <a href="#method.visit_str" class="fnname">visit_str</a>(&amp;mut self, value: &amp;str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a string.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_borrowed_str" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#120-122">source</a><h4 class="code-header">fn <a href="#method.visit_borrowed_str" class="fnname">visit_borrowed_str</a>(&amp;mut self, value: &amp;'v str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a string.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_char" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#126-129">source</a><h4 class="code-header">fn <a href="#method.visit_char" class="fnname">visit_char</a>(&amp;mut self, value: char) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit a Unicode character.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_error" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#134-136">source</a><h4 class="code-header">fn <a href="#method.visit_error" class="fnname">visit_error</a>(&amp;mut self, err: &amp;(dyn Error + 'static)) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit an error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.visit_borrowed_error" class="method has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#141-146">source</a><h4 class="code-header">fn <a href="#method.visit_borrowed_error" class="fnname">visit_borrowed_error</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self,<br>&nbsp;&nbsp;&nbsp;&nbsp;err: &amp;'v (dyn Error + 'static)<br>) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Visit an error.</p>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Visit%3C%27v%3E-for-%26%27a%20mut%20T" class="impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#149-217">source</a><a href="#impl-Visit%3C%27v%3E-for-%26%27a%20mut%20T" class="anchor"></a><h3 class="code-header">impl&lt;'a, 'v, T:&nbsp;?Sized&gt; <a class="trait" href="trait.Visit.html" title="trait value_bag::visit::Visit">Visit</a>&lt;'v&gt; for &amp;'a mut T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.Visit.html" title="trait value_bag::visit::Visit">Visit</a>&lt;'v&gt;,</span></h3></section></summary><div class="impl-items"><section id="method.visit_any" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#154-156">source</a><a href="#method.visit_any" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.visit_any" class="fnname">visit_any</a>(&amp;mut self, value: <a class="struct" href="../struct.ValueBag.html" title="struct value_bag::ValueBag">ValueBag</a>&lt;'_&gt;) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_u64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#159-161">source</a><a href="#method.visit_u64-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_u64" class="fnname">visit_u64</a>(&amp;mut self, value: u64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_i64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#164-166">source</a><a href="#method.visit_i64-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_i64" class="fnname">visit_i64</a>(&amp;mut self, value: i64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_u128-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#169-171">source</a><a href="#method.visit_u128-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_u128" class="fnname">visit_u128</a>(&amp;mut self, value: u128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_i128-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#174-176">source</a><a href="#method.visit_i128-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_i128" class="fnname">visit_i128</a>(&amp;mut self, value: i128) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_f64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#179-181">source</a><a href="#method.visit_f64-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_f64" class="fnname">visit_f64</a>(&amp;mut self, value: f64) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_bool-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#184-186">source</a><a href="#method.visit_bool-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_bool" class="fnname">visit_bool</a>(&amp;mut self, value: bool) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_str-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#189-191">source</a><a href="#method.visit_str-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_str" class="fnname">visit_str</a>(&amp;mut self, value: &amp;str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_borrowed_str-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#194-196">source</a><a href="#method.visit_borrowed_str-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_borrowed_str" class="fnname">visit_borrowed_str</a>(&amp;mut self, value: &amp;'v str) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_char-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#199-201">source</a><a href="#method.visit_char-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_char" class="fnname">visit_char</a>(&amp;mut self, value: char) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_error-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#205-207">source</a><a href="#method.visit_error-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_error" class="fnname">visit_error</a>(&amp;mut self, err: &amp;(dyn Error + 'static)) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section><section id="method.visit_borrowed_error-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/value_bag/visit.rs.html#211-216">source</a><a href="#method.visit_borrowed_error-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.visit_borrowed_error" class="fnname">visit_borrowed_error</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self,<br>&nbsp;&nbsp;&nbsp;&nbsp;err: &amp;'v (dyn Error + 'static)<br>) -&gt; Result&lt;(), <a class="struct" href="../struct.Error.html" title="struct value_bag::Error">Error</a>&gt;</h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"></div><script src="../../implementors/value_bag/visit/trait.Visit.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="value_bag" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>