]> Untitled Git - bitcoindevkit.org/blob
811f6fb02e8bb6a8c2bd0ac62ac9c371b508d52b
[bitcoindevkit.org] /
1 <!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="This trait represents a visitor that walks through a deserializer."><title>Visitor in bdk_chain::bitcoin::hashes::serde::de - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="bdk_chain" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (78a775127 2024-05-11)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.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" title="show sidebar"></button><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt="logo"></a><h2><a href="../../../../../bdk_chain/index.html">bdk_chain</a><span class="version">0.20.0</span></h2></div><h2 class="location"><a href="#">Visitor</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Value">Value</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.expecting">expecting</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_bytes">visit_borrowed_bytes</a></li><li><a href="#method.visit_borrowed_str">visit_borrowed_str</a></li><li><a href="#method.visit_byte_buf">visit_byte_buf</a></li><li><a href="#method.visit_bytes">visit_bytes</a></li><li><a href="#method.visit_char">visit_char</a></li><li><a href="#method.visit_enum">visit_enum</a></li><li><a href="#method.visit_f32">visit_f32</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_i16">visit_i16</a></li><li><a href="#method.visit_i32">visit_i32</a></li><li><a href="#method.visit_i64">visit_i64</a></li><li><a href="#method.visit_i8">visit_i8</a></li><li><a href="#method.visit_map">visit_map</a></li><li><a href="#method.visit_newtype_struct">visit_newtype_struct</a></li><li><a href="#method.visit_none">visit_none</a></li><li><a href="#method.visit_seq">visit_seq</a></li><li><a href="#method.visit_some">visit_some</a></li><li><a href="#method.visit_str">visit_str</a></li><li><a href="#method.visit_string">visit_string</a></li><li><a href="#method.visit_u128">visit_u128</a></li><li><a href="#method.visit_u16">visit_u16</a></li><li><a href="#method.visit_u32">visit_u32</a></li><li><a href="#method.visit_u64">visit_u64</a></li><li><a href="#method.visit_u8">visit_u8</a></li><li><a href="#method.visit_unit">visit_unit</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In bdk_chain::bitcoin::hashes::serde::de</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../../../../index.html">bdk_chain</a>::<wbr><a href="../../../index.html">bitcoin</a>::<wbr><a href="../../index.html">hashes</a>::<wbr><a href="../index.html">serde</a>::<wbr><a href="index.html">de</a>::<wbr><a class="trait" href="#">Visitor</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1284">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Visitor&lt;'de&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
2 type <a href="#associatedtype.Value" class="associatedtype">Value</a>;
3
4 <details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 28 methods</span></summary> // Required method
5 fn <a href="#tymethod.expecting" class="fn">expecting</a>(&amp;self, formatter: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;;
6
7 // Provided methods
8 fn <a href="#method.visit_bool" class="fn">visit_bool</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
9 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
10 <span class="item-spacer"></span> fn <a href="#method.visit_i8" class="fn">visit_i8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
11 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
12 <span class="item-spacer"></span> fn <a href="#method.visit_i16" class="fn">visit_i16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
13 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
14 <span class="item-spacer"></span> fn <a href="#method.visit_i32" class="fn">visit_i32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
15 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
16 <span class="item-spacer"></span> fn <a href="#method.visit_i64" class="fn">visit_i64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
17 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
18 <span class="item-spacer"></span> fn <a href="#method.visit_i128" class="fn">visit_i128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i128.html">i128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
19 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
20 <span class="item-spacer"></span> fn <a href="#method.visit_u8" class="fn">visit_u8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
21 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
22 <span class="item-spacer"></span> fn <a href="#method.visit_u16" class="fn">visit_u16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
23 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
24 <span class="item-spacer"></span> fn <a href="#method.visit_u32" class="fn">visit_u32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
25 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
26 <span class="item-spacer"></span> fn <a href="#method.visit_u64" class="fn">visit_u64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
27 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
28 <span class="item-spacer"></span> fn <a href="#method.visit_u128" class="fn">visit_u128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u128.html">u128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
29 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
30 <span class="item-spacer"></span> fn <a href="#method.visit_f32" class="fn">visit_f32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
31 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
32 <span class="item-spacer"></span> fn <a href="#method.visit_f64" class="fn">visit_f64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
33 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
34 <span class="item-spacer"></span> fn <a href="#method.visit_char" class="fn">visit_char</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
35 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
36 <span class="item-spacer"></span> fn <a href="#method.visit_str" class="fn">visit_str</a>&lt;E&gt;(self, v: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
37 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
38 <span class="item-spacer"></span> fn <a href="#method.visit_borrowed_str" class="fn">visit_borrowed_str</a>&lt;E&gt;(self, v: &amp;'de <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
39 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
40 <span class="item-spacer"></span> fn <a href="#method.visit_string" class="fn">visit_string</a>&lt;E&gt;(self, v: <a class="struct" href="../../../base58/struct.String.html" title="struct bdk_chain::bitcoin::base58::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
41 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
42 <span class="item-spacer"></span> fn <a href="#method.visit_bytes" class="fn">visit_bytes</a>&lt;E&gt;(self, v: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
43 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
44 <span class="item-spacer"></span> fn <a href="#method.visit_borrowed_bytes" class="fn">visit_borrowed_bytes</a>&lt;E&gt;(self, v: &amp;'de [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
45 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
46 <span class="item-spacer"></span> fn <a href="#method.visit_byte_buf" class="fn">visit_byte_buf</a>&lt;E&gt;(self, v: <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
47 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
48 <span class="item-spacer"></span> fn <a href="#method.visit_none" class="fn">visit_none</a>&lt;E&gt;(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;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
49 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
50 <span class="item-spacer"></span> fn <a href="#method.visit_some" class="fn">visit_some</a>&lt;D&gt;(
51 self,
52 deserializer: D
53 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;D as <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Deserializer::Error">Error</a>&gt;
54 <span class="where">where D: <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;</span> { ... }
55 <span class="item-spacer"></span> fn <a href="#method.visit_unit" class="fn">visit_unit</a>&lt;E&gt;(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;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;
56 <span class="where">where E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a></span> { ... }
57 <span class="item-spacer"></span> fn <a href="#method.visit_newtype_struct" class="fn">visit_newtype_struct</a>&lt;D&gt;(
58 self,
59 deserializer: D
60 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;D as <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Deserializer::Error">Error</a>&gt;
61 <span class="where">where D: <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;</span> { ... }
62 <span class="item-spacer"></span> fn <a href="#method.visit_seq" class="fn">visit_seq</a>&lt;A&gt;(
63 self,
64 seq: A
65 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.SeqAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.SeqAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::SeqAccess::Error">Error</a>&gt;
66 <span class="where">where A: <a class="trait" href="trait.SeqAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;</span> { ... }
67 <span class="item-spacer"></span> fn <a href="#method.visit_map" class="fn">visit_map</a>&lt;A&gt;(
68 self,
69 map: A
70 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.MapAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::MapAccess">MapAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.MapAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::MapAccess::Error">Error</a>&gt;
71 <span class="where">where A: <a class="trait" href="trait.MapAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::MapAccess">MapAccess</a>&lt;'de&gt;</span> { ... }
72 <span class="item-spacer"></span> fn <a href="#method.visit_enum" class="fn">visit_enum</a>&lt;A&gt;(
73 self,
74 data: A
75 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.EnumAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.EnumAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::EnumAccess::Error">Error</a>&gt;
76 <span class="where">where A: <a class="trait" href="trait.EnumAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;</span> { ... }
77 </details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This trait represents a visitor that walks through a deserializer.</p>
78 <h2 id="lifetime"><a class="doc-anchor" href="#lifetime">§</a>Lifetime</h2>
79 <p>The <code>'de</code> lifetime of this trait is the requirement for lifetime of data
80 that may be borrowed by <code>Self::Value</code>. See the page <a href="https://serde.rs/lifetimes.html">Understanding
81 deserializer lifetimes</a> for a more detailed explanation of these lifetimes.</p>
82 <h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
83 <div class="example-wrap edition"><a href="#" class="tooltip" title="This example runs with edition 2021">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="doccomment">/// A visitor that deserializes a long string - a string containing at least
84 /// some minimum number of bytes.
85 </span><span class="kw">struct </span>LongString {
86 min: usize,
87 }
88
89 <span class="kw">impl</span>&lt;<span class="lifetime">'de</span>&gt; Visitor&lt;<span class="lifetime">'de</span>&gt; <span class="kw">for </span>LongString {
90 <span class="kw">type </span>Value = String;
91
92 <span class="kw">fn </span>expecting(<span class="kw-2">&amp;</span><span class="self">self</span>, formatter: <span class="kw-2">&amp;mut </span>fmt::Formatter) -&gt; fmt::Result {
93 <span class="macro">write!</span>(formatter, <span class="string">"a string containing at least {} bytes"</span>, <span class="self">self</span>.min)
94 }
95
96 <span class="kw">fn </span>visit_str&lt;E&gt;(<span class="self">self</span>, s: <span class="kw-2">&amp;</span>str) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Value, E&gt;
97 <span class="kw">where
98 </span>E: de::Error,
99 {
100 <span class="kw">if </span>s.len() &gt;= <span class="self">self</span>.min {
101 <span class="prelude-val">Ok</span>(s.to_owned())
102 } <span class="kw">else </span>{
103 <span class="prelude-val">Err</span>(de::Error::invalid_value(Unexpected::Str(s), <span class="kw-2">&amp;</span><span class="self">self</span>))
104 }
105 }
106 }</code></pre></div>
107 </div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Value" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1286">source</a><h4 class="code-header">type <a href="#associatedtype.Value" class="associatedtype">Value</a></h4></section></summary><div class="docblock"><p>The value produced by this visitor.</p>
108 </div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.expecting" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1310">source</a><h4 class="code-header">fn <a href="#tymethod.expecting" class="fn">expecting</a>(&amp;self, formatter: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Format a message stating what data this Visitor expects to receive.</p>
109 <p>This is used in error messages. The message should complete the sentence
110 “This Visitor expects to receive …”, for example the message could be
111 “an integer between 0 and 64”. The message should not be capitalized and
112 should not end with a period.</p>
113
114 <div class="example-wrap edition"><a href="#" class="tooltip" title="This example runs with edition 2021">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>expecting(<span class="kw-2">&amp;</span><span class="self">self</span>, formatter: <span class="kw-2">&amp;mut </span>fmt::Formatter) -&gt; fmt::Result {
115 <span class="macro">write!</span>(formatter, <span class="string">"an integer between 0 and {}"</span>, <span class="self">self</span>.max)
116 }</code></pre></div>
117 </div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.visit_bool" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1315-1317">source</a><h4 class="code-header">fn <a href="#method.visit_bool" class="fn">visit_bool</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
118 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a boolean.</p>
119 <p>The default implementation fails with a type error.</p>
120 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_i8" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1327-1329">source</a><h4 class="code-header">fn <a href="#method.visit_i8" class="fn">visit_i8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
121 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>i8</code>.</p>
122 <p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
123 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_i16" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1339-1341">source</a><h4 class="code-header">fn <a href="#method.visit_i16" class="fn">visit_i16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
124 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>i16</code>.</p>
125 <p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
126 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_i32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1351-1353">source</a><h4 class="code-header">fn <a href="#method.visit_i32" class="fn">visit_i32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
127 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>i32</code>.</p>
128 <p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
129 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_i64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1361-1363">source</a><h4 class="code-header">fn <a href="#method.visit_i64" class="fn">visit_i64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
130 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>i64</code>.</p>
131 <p>The default implementation fails with a type error.</p>
132 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_i128" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1371-1373">source</a><h4 class="code-header">fn <a href="#method.visit_i128" class="fn">visit_i128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i128.html">i128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
133 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>i128</code>.</p>
134 <p>The default implementation fails with a type error.</p>
135 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_u8" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1389-1391">source</a><h4 class="code-header">fn <a href="#method.visit_u8" class="fn">visit_u8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
136 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>u8</code>.</p>
137 <p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
138 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_u16" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1401-1403">source</a><h4 class="code-header">fn <a href="#method.visit_u16" class="fn">visit_u16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
139 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>u16</code>.</p>
140 <p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
141 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_u32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1413-1415">source</a><h4 class="code-header">fn <a href="#method.visit_u32" class="fn">visit_u32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
142 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>u32</code>.</p>
143 <p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
144 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_u64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1423-1425">source</a><h4 class="code-header">fn <a href="#method.visit_u64" class="fn">visit_u64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
145 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>u64</code>.</p>
146 <p>The default implementation fails with a type error.</p>
147 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_u128" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1433-1435">source</a><h4 class="code-header">fn <a href="#method.visit_u128" class="fn">visit_u128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u128.html">u128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
148 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>u128</code>.</p>
149 <p>The default implementation fails with a type error.</p>
150 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_f32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1451-1453">source</a><h4 class="code-header">fn <a href="#method.visit_f32" class="fn">visit_f32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
151 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>f32</code>.</p>
152 <p>The default implementation forwards to <a href="#method.visit_f64"><code>visit_f64</code></a>.</p>
153 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_f64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1461-1463">source</a><h4 class="code-header">fn <a href="#method.visit_f64" class="fn">visit_f64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
154 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an <code>f64</code>.</p>
155 <p>The default implementation fails with a type error.</p>
156 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_char" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1475-1477">source</a><h4 class="code-header">fn <a href="#method.visit_char" class="fn">visit_char</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.char.html">char</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
157 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a <code>char</code>.</p>
158 <p>The default implementation forwards to <a href="#method.visit_str"><code>visit_str</code></a> as a one-character
159 string.</p>
160 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_str" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1493-1495">source</a><h4 class="code-header">fn <a href="#method.visit_str" class="fn">visit_str</a>&lt;E&gt;(self, v: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
161 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a string. The lifetime of the string is ephemeral and
162 it may be destroyed after this method returns.</p>
163 <p>This method allows the <code>Deserializer</code> to avoid a copy by retaining
164 ownership of any buffered data. <code>Deserialize</code> implementations that do
165 not benefit from taking ownership of <code>String</code> data should indicate that
166 to the deserializer by using <code>Deserializer::deserialize_str</code> rather than
167 <code>Deserializer::deserialize_string</code>.</p>
168 <p>It is never correct to implement <code>visit_string</code> without implementing
169 <code>visit_str</code>. Implement neither, both, or just <code>visit_str</code>.</p>
170 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_borrowed_str" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1510-1512">source</a><h4 class="code-header">fn <a href="#method.visit_borrowed_str" class="fn">visit_borrowed_str</a>&lt;E&gt;(self, v: &amp;'de <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
171 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a string that lives at least as long as the
172 <code>Deserializer</code>.</p>
173 <p>This enables zero-copy deserialization of strings in some formats. For
174 example JSON input containing the JSON string <code>&quot;borrowed&quot;</code> can be
175 deserialized with zero copying into a <code>&amp;'a str</code> as long as the input
176 data outlives <code>'a</code>.</p>
177 <p>The default implementation forwards to <code>visit_str</code>.</p>
178 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_string" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1535-1537">source</a><h4 class="code-header">fn <a href="#method.visit_string" class="fn">visit_string</a>&lt;E&gt;(self, v: <a class="struct" href="../../../base58/struct.String.html" title="struct bdk_chain::bitcoin::base58::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
179 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a string and ownership of the string is being given
180 to the <code>Visitor</code>.</p>
181 <p>This method allows the <code>Visitor</code> to avoid a copy by taking ownership of
182 a string created by the <code>Deserializer</code>. <code>Deserialize</code> implementations
183 that benefit from taking ownership of <code>String</code> data should indicate that
184 to the deserializer by using <code>Deserializer::deserialize_string</code> rather
185 than <code>Deserializer::deserialize_str</code>, although not every deserializer
186 will honor such a request.</p>
187 <p>It is never correct to implement <code>visit_string</code> without implementing
188 <code>visit_str</code>. Implement neither, both, or just <code>visit_str</code>.</p>
189 <p>The default implementation forwards to <code>visit_str</code> and then drops the
190 <code>String</code>.</p>
191 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_bytes" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1553-1555">source</a><h4 class="code-header">fn <a href="#method.visit_bytes" class="fn">visit_bytes</a>&lt;E&gt;(self, v: &amp;[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
192 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a byte array. The lifetime of the byte array is
193 ephemeral and it may be destroyed after this method returns.</p>
194 <p>This method allows the <code>Deserializer</code> to avoid a copy by retaining
195 ownership of any buffered data. <code>Deserialize</code> implementations that do
196 not benefit from taking ownership of <code>Vec&lt;u8&gt;</code> data should indicate that
197 to the deserializer by using <code>Deserializer::deserialize_bytes</code> rather
198 than <code>Deserializer::deserialize_byte_buf</code>.</p>
199 <p>It is never correct to implement <code>visit_byte_buf</code> without implementing
200 <code>visit_bytes</code>. Implement neither, both, or just <code>visit_bytes</code>.</p>
201 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_borrowed_bytes" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1569-1571">source</a><h4 class="code-header">fn <a href="#method.visit_borrowed_bytes" class="fn">visit_borrowed_bytes</a>&lt;E&gt;(self, v: &amp;'de [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
202 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a byte array that lives at least as long as the
203 <code>Deserializer</code>.</p>
204 <p>This enables zero-copy deserialization of bytes in some formats. For
205 example Postcard data containing bytes can be deserialized with zero
206 copying into a <code>&amp;'a [u8]</code> as long as the input data outlives <code>'a</code>.</p>
207 <p>The default implementation forwards to <code>visit_bytes</code>.</p>
208 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_byte_buf" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1594-1596">source</a><h4 class="code-header">fn <a href="#method.visit_byte_buf" class="fn">visit_byte_buf</a>&lt;E&gt;(self, v: <a class="struct" href="../../../base58/struct.Vec.html" title="struct bdk_chain::bitcoin::base58::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
209 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a byte array and ownership of the byte array is being
210 given to the <code>Visitor</code>.</p>
211 <p>This method allows the <code>Visitor</code> to avoid a copy by taking ownership of
212 a byte buffer created by the <code>Deserializer</code>. <code>Deserialize</code>
213 implementations that benefit from taking ownership of <code>Vec&lt;u8&gt;</code> data
214 should indicate that to the deserializer by using
215 <code>Deserializer::deserialize_byte_buf</code> rather than
216 <code>Deserializer::deserialize_bytes</code>, although not every deserializer will
217 honor such a request.</p>
218 <p>It is never correct to implement <code>visit_byte_buf</code> without implementing
219 <code>visit_bytes</code>. Implement neither, both, or just <code>visit_bytes</code>.</p>
220 <p>The default implementation forwards to <code>visit_bytes</code> and then drops the
221 <code>Vec&lt;u8&gt;</code>.</p>
222 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_none" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1604-1606">source</a><h4 class="code-header">fn <a href="#method.visit_none" class="fn">visit_none</a>&lt;E&gt;(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;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
223 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains an optional that is absent.</p>
224 <p>The default implementation fails with a type error.</p>
225 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_some" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1614-1616">source</a><h4 class="code-header">fn <a href="#method.visit_some" class="fn">visit_some</a>&lt;D&gt;(
226 self,
227 deserializer: D
228 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;D as <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Deserializer::Error">Error</a>&gt;<div class="where">where
229 D: <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;,</div></h4></section></summary><div class="docblock"><p>The input contains an optional that is present.</p>
230 <p>The default implementation fails with a type error.</p>
231 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_unit" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1625-1627">source</a><h4 class="code-header">fn <a href="#method.visit_unit" class="fn">visit_unit</a>&lt;E&gt;(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;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, E&gt;<div class="where">where
232 E: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Error">Error</a>,</div></h4></section></summary><div class="docblock"><p>The input contains a unit <code>()</code>.</p>
233 <p>The default implementation fails with a type error.</p>
234 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_newtype_struct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1638-1640">source</a><h4 class="code-header">fn <a href="#method.visit_newtype_struct" class="fn">visit_newtype_struct</a>&lt;D&gt;(
235 self,
236 deserializer: D
237 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;D as <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Deserializer::Error">Error</a>&gt;<div class="where">where
238 D: <a class="trait" href="../trait.Deserializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Deserializer">Deserializer</a>&lt;'de&gt;,</div></h4></section></summary><div class="docblock"><p>The input contains a newtype struct.</p>
239 <p>The content of the newtype struct may be read from the given
240 <code>Deserializer</code>.</p>
241 <p>The default implementation fails with a type error.</p>
242 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_seq" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1649-1651">source</a><h4 class="code-header">fn <a href="#method.visit_seq" class="fn">visit_seq</a>&lt;A&gt;(
243 self,
244 seq: A
245 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.SeqAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.SeqAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::SeqAccess::Error">Error</a>&gt;<div class="where">where
246 A: <a class="trait" href="trait.SeqAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;,</div></h4></section></summary><div class="docblock"><p>The input contains a sequence of elements.</p>
247 <p>The default implementation fails with a type error.</p>
248 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_map" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1660-1662">source</a><h4 class="code-header">fn <a href="#method.visit_map" class="fn">visit_map</a>&lt;A&gt;(
249 self,
250 map: A
251 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.MapAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::MapAccess">MapAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.MapAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::MapAccess::Error">Error</a>&gt;<div class="where">where
252 A: <a class="trait" href="trait.MapAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::MapAccess">MapAccess</a>&lt;'de&gt;,</div></h4></section></summary><div class="docblock"><p>The input contains a key-value map.</p>
253 <p>The default implementation fails with a type error.</p>
254 </div></details><details class="toggle method-toggle" open><summary><section id="method.visit_enum" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/mod.rs.html#1671-1673">source</a><h4 class="code-header">fn <a href="#method.visit_enum" class="fn">visit_enum</a>&lt;A&gt;(
255 self,
256 data: A
257 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type bdk_chain::bitcoin::hashes::serde::de::Visitor::Value">Value</a>, &lt;A as <a class="trait" href="trait.EnumAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;&gt;::<a class="associatedtype" href="trait.EnumAccess.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::de::EnumAccess::Error">Error</a>&gt;<div class="where">where
258 A: <a class="trait" href="trait.EnumAccess.html" title="trait bdk_chain::bitcoin::hashes::serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;,</div></h4></section></summary><div class="docblock"><p>The input contains an enum.</p>
259 <p>The default implementation fails with a type error.</p>
260 </div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Visitor%3C'de%3E-for-IgnoredAny" class="impl"><a class="src rightside" href="https://docs.rs/serde/1.0.214/src/serde/de/ignored_any.rs.html#113">source</a><a href="#impl-Visitor%3C'de%3E-for-IgnoredAny" class="anchor">§</a><h3 class="code-header">impl&lt;'de&gt; <a class="trait" href="trait.Visitor.html" title="trait bdk_chain::bitcoin::hashes::serde::de::Visitor">Visitor</a>&lt;'de&gt; for <a class="struct" href="struct.IgnoredAny.html" title="struct bdk_chain::bitcoin::hashes::serde::de::IgnoredAny">IgnoredAny</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Value-1" class="associatedtype trait-impl"><a href="#associatedtype.Value-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Value" class="associatedtype">Value</a> = <a class="struct" href="struct.IgnoredAny.html" title="struct bdk_chain::bitcoin::hashes::serde::de::IgnoredAny">IgnoredAny</a></h4></section></div></details></div><script src="../../../../../trait.impl/serde/de/trait.Visitor.js" data-ignore-extern-crates="serde" async></script></section></div></main></body></html>