]> Untitled Git - bitcoindevkit.org/blob
0d19637104ae9788dbd0b0f622edf2da63c45a3d
[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="A data format that can serialize any data structure supported by Serde."><title>Serializer in bdk_chain::bitcoin::hashes::serde::ser - 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.19.0</span></h2></div><h2 class="location"><a href="#">Serializer</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.Error">Error</a></li><li><a href="#associatedtype.Ok">Ok</a></li><li><a href="#associatedtype.SerializeMap">SerializeMap</a></li><li><a href="#associatedtype.SerializeSeq">SerializeSeq</a></li><li><a href="#associatedtype.SerializeStruct">SerializeStruct</a></li><li><a href="#associatedtype.SerializeStructVariant">SerializeStructVariant</a></li><li><a href="#associatedtype.SerializeTuple">SerializeTuple</a></li><li><a href="#associatedtype.SerializeTupleStruct">SerializeTupleStruct</a></li><li><a href="#associatedtype.SerializeTupleVariant">SerializeTupleVariant</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.serialize_bool">serialize_bool</a></li><li><a href="#tymethod.serialize_bytes">serialize_bytes</a></li><li><a href="#tymethod.serialize_char">serialize_char</a></li><li><a href="#tymethod.serialize_f32">serialize_f32</a></li><li><a href="#tymethod.serialize_f64">serialize_f64</a></li><li><a href="#tymethod.serialize_i16">serialize_i16</a></li><li><a href="#tymethod.serialize_i32">serialize_i32</a></li><li><a href="#tymethod.serialize_i64">serialize_i64</a></li><li><a href="#tymethod.serialize_i8">serialize_i8</a></li><li><a href="#tymethod.serialize_map">serialize_map</a></li><li><a href="#tymethod.serialize_newtype_struct">serialize_newtype_struct</a></li><li><a href="#tymethod.serialize_newtype_variant">serialize_newtype_variant</a></li><li><a href="#tymethod.serialize_none">serialize_none</a></li><li><a href="#tymethod.serialize_seq">serialize_seq</a></li><li><a href="#tymethod.serialize_some">serialize_some</a></li><li><a href="#tymethod.serialize_str">serialize_str</a></li><li><a href="#tymethod.serialize_struct">serialize_struct</a></li><li><a href="#tymethod.serialize_struct_variant">serialize_struct_variant</a></li><li><a href="#tymethod.serialize_tuple">serialize_tuple</a></li><li><a href="#tymethod.serialize_tuple_struct">serialize_tuple_struct</a></li><li><a href="#tymethod.serialize_tuple_variant">serialize_tuple_variant</a></li><li><a href="#tymethod.serialize_u16">serialize_u16</a></li><li><a href="#tymethod.serialize_u32">serialize_u32</a></li><li><a href="#tymethod.serialize_u64">serialize_u64</a></li><li><a href="#tymethod.serialize_u8">serialize_u8</a></li><li><a href="#tymethod.serialize_unit">serialize_unit</a></li><li><a href="#tymethod.serialize_unit_struct">serialize_unit_struct</a></li><li><a href="#tymethod.serialize_unit_variant">serialize_unit_variant</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.collect_map">collect_map</a></li><li><a href="#method.collect_seq">collect_seq</a></li><li><a href="#method.collect_str">collect_str</a></li><li><a href="#method.is_human_readable">is_human_readable</a></li><li><a href="#method.serialize_i128">serialize_i128</a></li><li><a href="#method.serialize_u128">serialize_u128</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Serializer-for-%26mut+Formatter%3C'b%3E">&amp;&#x27;a mut Formatter&lt;&#x27;b&gt;</a></li><li><a href="#impl-Serializer-for-%26mut+Serializer%3CW,+F%3E">&amp;&#x27;a mut Serializer&lt;W, F&gt;</a></li><li><a href="#impl-Serializer-for-Serializer">Serializer</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::ser</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">ser</a>::<wbr><a class="trait" href="#">Serializer</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.210/src/serde/ser/mod.rs.html#340">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 Serializer: <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.Ok" class="associatedtype">Ok</a>;
3 type <a href="#associatedtype.Error" class="associatedtype">Error</a>: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::Error">Error</a>;
4 type <a href="#associatedtype.SerializeSeq" class="associatedtype">SerializeSeq</a>: <a class="trait" href="trait.SerializeSeq.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeSeq">SerializeSeq</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
5 type <a href="#associatedtype.SerializeTuple" class="associatedtype">SerializeTuple</a>: <a class="trait" href="trait.SerializeTuple.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTuple">SerializeTuple</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
6 type <a href="#associatedtype.SerializeTupleStruct" class="associatedtype">SerializeTupleStruct</a>: <a class="trait" href="trait.SerializeTupleStruct.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTupleStruct">SerializeTupleStruct</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
7 type <a href="#associatedtype.SerializeTupleVariant" class="associatedtype">SerializeTupleVariant</a>: <a class="trait" href="trait.SerializeTupleVariant.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTupleVariant">SerializeTupleVariant</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
8 type <a href="#associatedtype.SerializeMap" class="associatedtype">SerializeMap</a>: <a class="trait" href="trait.SerializeMap.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeMap">SerializeMap</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
9 type <a href="#associatedtype.SerializeStruct" class="associatedtype">SerializeStruct</a>: <a class="trait" href="trait.SerializeStruct.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeStruct">SerializeStruct</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
10 type <a href="#associatedtype.SerializeStructVariant" class="associatedtype">SerializeStructVariant</a>: <a class="trait" href="trait.SerializeStructVariant.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeStructVariant">SerializeStructVariant</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
11
12 <details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 34 methods</span></summary> // Required methods
13 fn <a href="#tymethod.serialize_bool" class="fn">serialize_bool</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
14 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_i8" class="fn">serialize_i8</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
15 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_i16" class="fn">serialize_i16</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
16 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_i32" class="fn">serialize_i32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
17 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_i64" class="fn">serialize_i64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
18 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_u8" class="fn">serialize_u8</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
19 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_u16" class="fn">serialize_u16</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
20 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_u32" class="fn">serialize_u32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
21 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_u64" class="fn">serialize_u64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
22 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_f32" class="fn">serialize_f32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
23 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_f64" class="fn">serialize_f64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
24 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_char" class="fn">serialize_char</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
25 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_str" class="fn">serialize_str</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
26 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_bytes" class="fn">serialize_bytes</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
27 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_none" class="fn">serialize_none</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
28 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_some" class="fn">serialize_some</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
29 <span class="where">where T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>;
30 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_unit" class="fn">serialize_unit</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
31 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_unit_struct" class="fn">serialize_unit_struct</a>(
32 self,
33 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
34 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
35 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_unit_variant" class="fn">serialize_unit_variant</a>(
36 self,
37 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
38 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
39 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
40 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
41 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_newtype_struct" class="fn">serialize_newtype_struct</a>&lt;T&gt;(
42 self,
43 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
44 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
45 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
46 <span class="where">where T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>;
47 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_newtype_variant" class="fn">serialize_newtype_variant</a>&lt;T&gt;(
48 self,
49 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
50 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
51 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
52 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
54 <span class="where">where T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>;
55 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_seq" class="fn">serialize_seq</a>(
56 self,
57 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
58 ) -&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.Serializer.html#associatedtype.SerializeSeq" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeSeq">SerializeSeq</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
59 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_tuple" class="fn">serialize_tuple</a>(
60 self,
61 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
62 ) -&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.Serializer.html#associatedtype.SerializeTuple" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTuple">SerializeTuple</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
63 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_tuple_struct" class="fn">serialize_tuple_struct</a>(
64 self,
65 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
66 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
67 ) -&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.Serializer.html#associatedtype.SerializeTupleStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleStruct">SerializeTupleStruct</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
68 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_tuple_variant" class="fn">serialize_tuple_variant</a>(
69 self,
70 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
71 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
72 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
73 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
74 ) -&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.Serializer.html#associatedtype.SerializeTupleVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleVariant">SerializeTupleVariant</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
75 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_map" class="fn">serialize_map</a>(
76 self,
77 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
78 ) -&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.Serializer.html#associatedtype.SerializeMap" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeMap">SerializeMap</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
79 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_struct" class="fn">serialize_struct</a>(
80 self,
81 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
82 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
83 ) -&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.Serializer.html#associatedtype.SerializeStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStruct">SerializeStruct</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
84 <span class="item-spacer"></span> fn <a href="#tymethod.serialize_struct_variant" class="fn">serialize_struct_variant</a>(
85 self,
86 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
87 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
88 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
89 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
90 ) -&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.Serializer.html#associatedtype.SerializeStructVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStructVariant">SerializeStructVariant</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;;
91
92 // Provided methods
93 fn <a href="#method.serialize_i128" class="fn">serialize_i128</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt; { ... }
94 <span class="item-spacer"></span> fn <a href="#method.serialize_u128" class="fn">serialize_u128</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt; { ... }
95 <span class="item-spacer"></span> fn <a href="#method.collect_seq" class="fn">collect_seq</a>&lt;I&gt;(self, iter: I) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
96 <span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,
97 &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a></span> { ... }
98 <span class="item-spacer"></span> fn <a href="#method.collect_map" class="fn">collect_map</a>&lt;K, V, I&gt;(self, iter: I) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
99 <span class="where">where K: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a>,
100 V: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a>,
101 I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(K, V)</a>&gt;</span> { ... }
102 <span class="item-spacer"></span> fn <a href="#method.collect_str" class="fn">collect_str</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;
103 <span class="where">where T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
104 <span class="item-spacer"></span> fn <a href="#method.is_human_readable" class="fn">is_human_readable</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
105 </details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A <strong>data format</strong> that can serialize any data structure supported by Serde.</p>
106 <p>The role of this trait is to define the serialization half of the <a href="https://serde.rs/data-model.html">Serde
107 data model</a>, which is a way to categorize every Rust data structure into one
108 of 29 possible types. Each method of the <code>Serializer</code> trait corresponds to
109 one of the types of the data model.</p>
110 <p>Implementations of <code>Serialize</code> map themselves into this data model by
111 invoking exactly one of the <code>Serializer</code> methods.</p>
112 <p>The types that make up the Serde data model are:</p>
113 <ul>
114 <li><strong>14 primitive types</strong>
115 <ul>
116 <li>bool</li>
117 <li>i8, i16, i32, i64, i128</li>
118 <li>u8, u16, u32, u64, u128</li>
119 <li>f32, f64</li>
120 <li>char</li>
121 </ul>
122 </li>
123 <li><strong>string</strong>
124 <ul>
125 <li>UTF-8 bytes with a length and no null terminator.</li>
126 <li>When serializing, all strings are handled equally. When deserializing,
127 there are three flavors of strings: transient, owned, and borrowed.</li>
128 </ul>
129 </li>
130 <li><strong>byte array</strong> - [u8]
131 <ul>
132 <li>Similar to strings, during deserialization byte arrays can be
133 transient, owned, or borrowed.</li>
134 </ul>
135 </li>
136 <li><strong>option</strong>
137 <ul>
138 <li>Either none or some value.</li>
139 </ul>
140 </li>
141 <li><strong>unit</strong>
142 <ul>
143 <li>The type of <code>()</code> in Rust. It represents an anonymous value containing
144 no data.</li>
145 </ul>
146 </li>
147 <li><strong>unit_struct</strong>
148 <ul>
149 <li>For example <code>struct Unit</code> or <code>PhantomData&lt;T&gt;</code>. It represents a named
150 value containing no data.</li>
151 </ul>
152 </li>
153 <li><strong>unit_variant</strong>
154 <ul>
155 <li>For example the <code>E::A</code> and <code>E::B</code> in <code>enum E { A, B }</code>.</li>
156 </ul>
157 </li>
158 <li><strong>newtype_struct</strong>
159 <ul>
160 <li>For example <code>struct Millimeters(u8)</code>.</li>
161 </ul>
162 </li>
163 <li><strong>newtype_variant</strong>
164 <ul>
165 <li>For example the <code>E::N</code> in <code>enum E { N(u8) }</code>.</li>
166 </ul>
167 </li>
168 <li><strong>seq</strong>
169 <ul>
170 <li>A variably sized heterogeneous sequence of values, for example
171 <code>Vec&lt;T&gt;</code> or <code>HashSet&lt;T&gt;</code>. When serializing, the length may or may not
172 be known before iterating through all the data. When deserializing,
173 the length is determined by looking at the serialized data.</li>
174 </ul>
175 </li>
176 <li><strong>tuple</strong>
177 <ul>
178 <li>A statically sized heterogeneous sequence of values for which the
179 length will be known at deserialization time without looking at the
180 serialized data, for example <code>(u8,)</code> or <code>(String, u64, Vec&lt;T&gt;)</code> or
181 <code>[u64; 10]</code>.</li>
182 </ul>
183 </li>
184 <li><strong>tuple_struct</strong>
185 <ul>
186 <li>A named tuple, for example <code>struct Rgb(u8, u8, u8)</code>.</li>
187 </ul>
188 </li>
189 <li><strong>tuple_variant</strong>
190 <ul>
191 <li>For example the <code>E::T</code> in <code>enum E { T(u8, u8) }</code>.</li>
192 </ul>
193 </li>
194 <li><strong>map</strong>
195 <ul>
196 <li>A heterogeneous key-value pairing, for example <code>BTreeMap&lt;K, V&gt;</code>.</li>
197 </ul>
198 </li>
199 <li><strong>struct</strong>
200 <ul>
201 <li>A heterogeneous key-value pairing in which the keys are strings and
202 will be known at deserialization time without looking at the
203 serialized data, for example <code>struct S { r: u8, g: u8, b: u8 }</code>.</li>
204 </ul>
205 </li>
206 <li><strong>struct_variant</strong>
207 <ul>
208 <li>For example the <code>E::S</code> in <code>enum E { S { r: u8, g: u8, b: u8 } }</code>.</li>
209 </ul>
210 </li>
211 </ul>
212 <p>Many Serde serializers produce text or binary data as output, for example
213 JSON or Postcard. This is not a requirement of the <code>Serializer</code> trait, and
214 there are serializers that do not produce text or binary output. One example
215 is the <code>serde_json::value::Serializer</code> (distinct from the main <code>serde_json</code>
216 serializer) that produces a <code>serde_json::Value</code> data structure in memory as
217 output.</p>
218 <h2 id="example-implementation"><a class="doc-anchor" href="#example-implementation">§</a>Example implementation</h2>
219 <p>The <a href="https://serde.rs/data-format.html">example data format</a> presented on the website contains example code for
220 a basic JSON <code>Serializer</code>.</p>
221 </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.Ok" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#349">source</a><h4 class="code-header">type <a href="#associatedtype.Ok" class="associatedtype">Ok</a></h4></section></summary><div class="docblock"><p>The output type produced by this <code>Serializer</code> during successful
222 serialization. Most serializers that produce text or binary output
223 should set <code>Ok = ()</code> and serialize into an <a href="https://doc.rust-lang.org/std/io/trait.Write.html"><code>io::Write</code></a> or buffer
224 contained within the <code>Serializer</code> instance. Serializers that build
225 in-memory data structures may be simplified by using <code>Ok</code> to propagate
226 the data structure around.</p>
227 </div></details><details class="toggle" open><summary><section id="associatedtype.Error" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#352">source</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a>: <a class="trait" href="trait.Error.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::Error">Error</a></h4></section></summary><div class="docblock"><p>The error type when some error occurs during serialization.</p>
228 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeSeq" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#358">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeSeq" class="associatedtype">SerializeSeq</a>: <a class="trait" href="trait.SerializeSeq.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeSeq">SerializeSeq</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_seq"><code>serialize_seq</code></a> for serializing the content of the
229 sequence.</p>
230 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeTuple" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#364">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeTuple" class="associatedtype">SerializeTuple</a>: <a class="trait" href="trait.SerializeTuple.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTuple">SerializeTuple</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_tuple"><code>serialize_tuple</code></a> for serializing the content of
231 the tuple.</p>
232 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeTupleStruct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#370">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleStruct" class="associatedtype">SerializeTupleStruct</a>: <a class="trait" href="trait.SerializeTupleStruct.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTupleStruct">SerializeTupleStruct</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_tuple_struct"><code>serialize_tuple_struct</code></a> for serializing the
233 content of the tuple struct.</p>
234 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeTupleVariant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#376">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleVariant" class="associatedtype">SerializeTupleVariant</a>: <a class="trait" href="trait.SerializeTupleVariant.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeTupleVariant">SerializeTupleVariant</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_tuple_variant"><code>serialize_tuple_variant</code></a> for serializing the
235 content of the tuple variant.</p>
236 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeMap" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#382">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeMap" class="associatedtype">SerializeMap</a>: <a class="trait" href="trait.SerializeMap.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeMap">SerializeMap</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_map"><code>serialize_map</code></a> for serializing the content of the
237 map.</p>
238 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeStruct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#388">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeStruct" class="associatedtype">SerializeStruct</a>: <a class="trait" href="trait.SerializeStruct.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeStruct">SerializeStruct</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_struct"><code>serialize_struct</code></a> for serializing the content of
239 the struct.</p>
240 </div></details><details class="toggle" open><summary><section id="associatedtype.SerializeStructVariant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#394">source</a><h4 class="code-header">type <a href="#associatedtype.SerializeStructVariant" class="associatedtype">SerializeStructVariant</a>: <a class="trait" href="trait.SerializeStructVariant.html" title="trait bdk_chain::bitcoin::hashes::serde::ser::SerializeStructVariant">SerializeStructVariant</a>&lt;Ok = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Error = Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Type returned from <a href="#tymethod.serialize_struct_variant"><code>serialize_struct_variant</code></a> for serializing the
241 content of the struct variant.</p>
242 </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.serialize_bool" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#412">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_bool" class="fn">serialize_bool</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>bool</code> value.</p>
243
244 <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">impl </span>Serialize <span class="kw">for </span>bool {
245 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
246 <span class="kw">where
247 </span>S: Serializer,
248 {
249 serializer.serialize_bool(<span class="kw-2">*</span><span class="self">self</span>)
250 }
251 }</code></pre></div>
252 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_i8" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#434">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_i8" class="fn">serialize_i8</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>i8</code> value.</p>
253 <p>If the format does not differentiate between <code>i8</code> and <code>i64</code>, a
254 reasonable implementation would be to cast the value to <code>i64</code> and
255 forward to <code>serialize_i64</code>.</p>
256
257 <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">impl </span>Serialize <span class="kw">for </span>i8 {
258 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
259 <span class="kw">where
260 </span>S: Serializer,
261 {
262 serializer.serialize_i8(<span class="kw-2">*</span><span class="self">self</span>)
263 }
264 }</code></pre></div>
265 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_i16" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#456">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_i16" class="fn">serialize_i16</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>i16</code> value.</p>
266 <p>If the format does not differentiate between <code>i16</code> and <code>i64</code>, a
267 reasonable implementation would be to cast the value to <code>i64</code> and
268 forward to <code>serialize_i64</code>.</p>
269
270 <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">impl </span>Serialize <span class="kw">for </span>i16 {
271 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
272 <span class="kw">where
273 </span>S: Serializer,
274 {
275 serializer.serialize_i16(<span class="kw-2">*</span><span class="self">self</span>)
276 }
277 }</code></pre></div>
278 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_i32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#478">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_i32" class="fn">serialize_i32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>i32</code> value.</p>
279 <p>If the format does not differentiate between <code>i32</code> and <code>i64</code>, a
280 reasonable implementation would be to cast the value to <code>i64</code> and
281 forward to <code>serialize_i64</code>.</p>
282
283 <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">impl </span>Serialize <span class="kw">for </span>i32 {
284 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
285 <span class="kw">where
286 </span>S: Serializer,
287 {
288 serializer.serialize_i32(<span class="kw-2">*</span><span class="self">self</span>)
289 }
290 }</code></pre></div>
291 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_i64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#496">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_i64" class="fn">serialize_i64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>i64</code> value.</p>
292
293 <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">impl </span>Serialize <span class="kw">for </span>i64 {
294 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
295 <span class="kw">where
296 </span>S: Serializer,
297 {
298 serializer.serialize_i64(<span class="kw-2">*</span><span class="self">self</span>)
299 }
300 }</code></pre></div>
301 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_u8" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#541">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_u8" class="fn">serialize_u8</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>u8</code> value.</p>
302 <p>If the format does not differentiate between <code>u8</code> and <code>u64</code>, a
303 reasonable implementation would be to cast the value to <code>u64</code> and
304 forward to <code>serialize_u64</code>.</p>
305
306 <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">impl </span>Serialize <span class="kw">for </span>u8 {
307 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
308 <span class="kw">where
309 </span>S: Serializer,
310 {
311 serializer.serialize_u8(<span class="kw-2">*</span><span class="self">self</span>)
312 }
313 }</code></pre></div>
314 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_u16" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#563">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_u16" class="fn">serialize_u16</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>u16</code> value.</p>
315 <p>If the format does not differentiate between <code>u16</code> and <code>u64</code>, a
316 reasonable implementation would be to cast the value to <code>u64</code> and
317 forward to <code>serialize_u64</code>.</p>
318
319 <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">impl </span>Serialize <span class="kw">for </span>u16 {
320 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
321 <span class="kw">where
322 </span>S: Serializer,
323 {
324 serializer.serialize_u16(<span class="kw-2">*</span><span class="self">self</span>)
325 }
326 }</code></pre></div>
327 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_u32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#585">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_u32" class="fn">serialize_u32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>u32</code> value.</p>
328 <p>If the format does not differentiate between <code>u32</code> and <code>u64</code>, a
329 reasonable implementation would be to cast the value to <code>u64</code> and
330 forward to <code>serialize_u64</code>.</p>
331
332 <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">impl </span>Serialize <span class="kw">for </span>u32 {
333 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
334 <span class="kw">where
335 </span>S: Serializer,
336 {
337 serializer.serialize_u32(<span class="kw-2">*</span><span class="self">self</span>)
338 }
339 }</code></pre></div>
340 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_u64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#603">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_u64" class="fn">serialize_u64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>u64</code> value.</p>
341
342 <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">impl </span>Serialize <span class="kw">for </span>u64 {
343 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
344 <span class="kw">where
345 </span>S: Serializer,
346 {
347 serializer.serialize_u64(<span class="kw-2">*</span><span class="self">self</span>)
348 }
349 }</code></pre></div>
350 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_f32" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#648">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_f32" class="fn">serialize_f32</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>f32</code> value.</p>
351 <p>If the format does not differentiate between <code>f32</code> and <code>f64</code>, a
352 reasonable implementation would be to cast the value to <code>f64</code> and
353 forward to <code>serialize_f64</code>.</p>
354
355 <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">impl </span>Serialize <span class="kw">for </span>f32 {
356 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
357 <span class="kw">where
358 </span>S: Serializer,
359 {
360 serializer.serialize_f32(<span class="kw-2">*</span><span class="self">self</span>)
361 }
362 }</code></pre></div>
363 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_f64" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#666">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_f64" class="fn">serialize_f64</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>f64</code> value.</p>
364
365 <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">impl </span>Serialize <span class="kw">for </span>f64 {
366 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
367 <span class="kw">where
368 </span>S: Serializer,
369 {
370 serializer.serialize_f64(<span class="kw-2">*</span><span class="self">self</span>)
371 }
372 }</code></pre></div>
373 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_char" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#687">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_char" class="fn">serialize_char</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a character.</p>
374 <p>If the format does not support characters, it is reasonable to serialize
375 it as a single element <code>str</code> or a <code>u32</code>.</p>
376
377 <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">impl </span>Serialize <span class="kw">for </span>char {
378 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
379 <span class="kw">where
380 </span>S: Serializer,
381 {
382 serializer.serialize_char(<span class="kw-2">*</span><span class="self">self</span>)
383 }
384 }</code></pre></div>
385 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_str" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#705">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_str" class="fn">serialize_str</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>&amp;str</code>.</p>
386
387 <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">impl </span>Serialize <span class="kw">for </span>str {
388 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
389 <span class="kw">where
390 </span>S: Serializer,
391 {
392 serializer.serialize_str(<span class="self">self</span>)
393 }
394 }</code></pre></div>
395 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_bytes" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#740">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_bytes" class="fn">serialize_bytes</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a chunk of raw byte data.</p>
396 <p>Enables serializers to serialize byte slices more compactly or more
397 efficiently than other types of slices. If no efficient implementation
398 is available, a reasonable implementation would be to forward to
399 <code>serialize_seq</code>. If forwarded, the implementation looks usually just
400 like this:</p>
401
402 <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>serialize_bytes(<span class="self">self</span>, v: <span class="kw-2">&amp;</span>[u8]) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>::Ok, <span class="self">Self</span>::Error&gt; {
403 <span class="kw">let </span><span class="kw-2">mut </span>seq = <span class="self">self</span>.serialize_seq(<span class="prelude-val">Some</span>(v.len()))<span class="question-mark">?</span>;
404 <span class="kw">for </span>b <span class="kw">in </span>v {
405 seq.serialize_element(b)<span class="question-mark">?</span>;
406 }
407 seq.end()
408 }</code></pre></div>
409 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_none" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#773">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_none" class="fn">serialize_none</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <a href="https://doc.rust-lang.org/std/option/enum.Option.html#variant.None"><code>None</code></a> value.</p>
410
411 <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">impl</span>&lt;T&gt; Serialize <span class="kw">for </span><span class="prelude-ty">Option</span>&lt;T&gt;
412 <span class="kw">where
413 </span>T: Serialize,
414 {
415 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
416 <span class="kw">where
417 </span>S: Serializer,
418 {
419 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
420 <span class="prelude-val">Some</span>(<span class="kw-2">ref </span>value) =&gt; serializer.serialize_some(value),
421 <span class="prelude-val">None </span>=&gt; serializer.serialize_none(),
422 }
423 }
424 }</code></pre></div>
425 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_some" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#806-808">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_some" class="fn">serialize_some</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
426 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Serialize a <a href="https://doc.rust-lang.org/std/option/enum.Option.html#variant.Some"><code>Some(T)</code></a> value.</p>
427
428 <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">impl</span>&lt;T&gt; Serialize <span class="kw">for </span><span class="prelude-ty">Option</span>&lt;T&gt;
429 <span class="kw">where
430 </span>T: Serialize,
431 {
432 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
433 <span class="kw">where
434 </span>S: Serializer,
435 {
436 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
437 <span class="prelude-val">Some</span>(<span class="kw-2">ref </span>value) =&gt; serializer.serialize_some(value),
438 <span class="prelude-val">None </span>=&gt; serializer.serialize_none(),
439 }
440 }
441 }</code></pre></div>
442 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_unit" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#826">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit" class="fn">serialize_unit</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>()</code> value.</p>
443
444 <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">impl </span>Serialize <span class="kw">for </span>() {
445 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
446 <span class="kw">where
447 </span>S: Serializer,
448 {
449 serializer.serialize_unit()
450 }
451 }</code></pre></div>
452 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_unit_struct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#846">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_struct" class="fn">serialize_unit_struct</a>(
453 self,
454 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
455 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a unit struct like <code>struct Unit</code> or <code>PhantomData&lt;T&gt;</code>.</p>
456 <p>A reasonable implementation would be to forward to <code>serialize_unit</code>.</p>
457
458 <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">use </span>serde::{Serialize, Serializer};
459
460 <span class="kw">struct </span>Nothing;
461
462 <span class="kw">impl </span>Serialize <span class="kw">for </span>Nothing {
463 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
464 <span class="kw">where
465 </span>S: Serializer,
466 {
467 serializer.serialize_unit_struct(<span class="string">"Nothing"</span>)
468 }
469 }</code></pre></div>
470 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_unit_variant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#874-879">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_variant" class="fn">serialize_unit_variant</a>(
471 self,
472 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
473 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
474 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
475 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a unit variant like <code>E::A</code> in <code>enum E { A, B }</code>.</p>
476 <p>The <code>name</code> is the name of the enum, the <code>variant_index</code> is the index of
477 this variant within the enum, and the <code>variant</code> is the name of the
478 variant.</p>
479
480 <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">use </span>serde::{Serialize, Serializer};
481
482 <span class="kw">enum </span>E {
483 A,
484 B,
485 }
486
487 <span class="kw">impl </span>Serialize <span class="kw">for </span>E {
488 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
489 <span class="kw">where
490 </span>S: Serializer,
491 {
492 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
493 E::A =&gt; serializer.serialize_unit_variant(<span class="string">"E"</span>, <span class="number">0</span>, <span class="string">"A"</span>),
494 E::B =&gt; serializer.serialize_unit_variant(<span class="string">"E"</span>, <span class="number">1</span>, <span class="string">"B"</span>),
495 }
496 }
497 }</code></pre></div>
498 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_newtype_struct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#901-907">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_struct" class="fn">serialize_newtype_struct</a>&lt;T&gt;(
499 self,
500 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
501 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
502 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
503 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Serialize a newtype struct like <code>struct Millimeters(u8)</code>.</p>
504 <p>Serializers are encouraged to treat newtype structs as insignificant
505 wrappers around the data they contain. A reasonable implementation would
506 be to forward to <code>value.serialize(self)</code>.</p>
507
508 <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">use </span>serde::{Serialize, Serializer};
509
510 <span class="kw">struct </span>Millimeters(u8);
511
512 <span class="kw">impl </span>Serialize <span class="kw">for </span>Millimeters {
513 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
514 <span class="kw">where
515 </span>S: Serializer,
516 {
517 serializer.serialize_newtype_struct(<span class="string">"Millimeters"</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>)
518 }
519 }</code></pre></div>
520 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_newtype_variant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#935-943">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_variant" class="fn">serialize_newtype_variant</a>&lt;T&gt;(
521 self,
522 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
523 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
524 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
525 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
526 ) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
527 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Serialize a newtype variant like <code>E::N</code> in <code>enum E { N(u8) }</code>.</p>
528 <p>The <code>name</code> is the name of the enum, the <code>variant_index</code> is the index of
529 this variant within the enum, and the <code>variant</code> is the name of the
530 variant. The <code>value</code> is the data contained within this newtype variant.</p>
531
532 <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">use </span>serde::{Serialize, Serializer};
533
534 <span class="kw">enum </span>E {
535 M(String),
536 N(u8),
537 }
538
539 <span class="kw">impl </span>Serialize <span class="kw">for </span>E {
540 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
541 <span class="kw">where
542 </span>S: Serializer,
543 {
544 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
545 E::M(<span class="kw-2">ref </span>s) =&gt; serializer.serialize_newtype_variant(<span class="string">"E"</span>, <span class="number">0</span>, <span class="string">"M"</span>, s),
546 E::N(n) =&gt; serializer.serialize_newtype_variant(<span class="string">"E"</span>, <span class="number">1</span>, <span class="string">"N"</span>, <span class="kw-2">&amp;</span>n),
547 }
548 }
549 }</code></pre></div>
550 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_seq" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#991">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_seq" class="fn">serialize_seq</a>(
551 self,
552 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
553 ) -&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.Serializer.html#associatedtype.SerializeSeq" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeSeq">SerializeSeq</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a variably sized sequence. This call must be
554 followed by zero or more calls to <code>serialize_element</code>, then a call to
555 <code>end</code>.</p>
556 <p>The argument is the number of elements in the sequence, which may or may
557 not be computable before the sequence is iterated. Some serializers only
558 support sequences whose length is known up front.</p>
559
560 <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">use </span>serde::ser::{Serialize, SerializeSeq, Serializer};
561
562 <span class="kw">impl</span>&lt;T&gt; Serialize <span class="kw">for </span>Vec&lt;T&gt;
563 <span class="kw">where
564 </span>T: Serialize,
565 {
566 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
567 <span class="kw">where
568 </span>S: Serializer,
569 {
570 <span class="kw">let </span><span class="kw-2">mut </span>seq = serializer.serialize_seq(<span class="prelude-val">Some</span>(<span class="self">self</span>.len()))<span class="question-mark">?</span>;
571 <span class="kw">for </span>element <span class="kw">in </span><span class="self">self </span>{
572 seq.serialize_element(element)<span class="question-mark">?</span>;
573 }
574 seq.end()
575 }
576 }</code></pre></div>
577 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_tuple" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1047">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple" class="fn">serialize_tuple</a>(
578 self,
579 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
580 ) -&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.Serializer.html#associatedtype.SerializeTuple" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTuple">SerializeTuple</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a statically sized sequence whose length will be
581 known at deserialization time without looking at the serialized data.
582 This call must be followed by zero or more calls to <code>serialize_element</code>,
583 then a call to <code>end</code>.</p>
584
585 <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">use </span>serde::ser::{Serialize, SerializeTuple, Serializer};
586
587 <span class="kw">impl</span>&lt;A, B, C&gt; Serialize <span class="kw">for </span>(A, B, C)
588 <span class="kw">where
589 </span>A: Serialize,
590 B: Serialize,
591 C: Serialize,
592 {
593 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
594 <span class="kw">where
595 </span>S: Serializer,
596 {
597 <span class="kw">let </span><span class="kw-2">mut </span>tup = serializer.serialize_tuple(<span class="number">3</span>)<span class="question-mark">?</span>;
598 tup.serialize_element(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>)<span class="question-mark">?</span>;
599 tup.serialize_element(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">1</span>)<span class="question-mark">?</span>;
600 tup.serialize_element(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">2</span>)<span class="question-mark">?</span>;
601 tup.end()
602 }
603 }</code></pre></div>
604
605 <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">use </span>serde::ser::{Serialize, SerializeTuple, Serializer};
606
607 <span class="kw">const </span>VRAM_SIZE: usize = <span class="number">386</span>;
608 <span class="kw">struct </span>Vram([u16; VRAM_SIZE]);
609
610 <span class="kw">impl </span>Serialize <span class="kw">for </span>Vram {
611 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
612 <span class="kw">where
613 </span>S: Serializer,
614 {
615 <span class="kw">let </span><span class="kw-2">mut </span>seq = serializer.serialize_tuple(VRAM_SIZE)<span class="question-mark">?</span>;
616 <span class="kw">for </span>element <span class="kw">in </span><span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>[..] {
617 seq.serialize_element(element)<span class="question-mark">?</span>;
618 }
619 seq.end()
620 }
621 }</code></pre></div>
622 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_tuple_struct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1074-1078">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_struct" class="fn">serialize_tuple_struct</a>(
623 self,
624 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
625 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
626 ) -&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.Serializer.html#associatedtype.SerializeTupleStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleStruct">SerializeTupleStruct</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a tuple struct like <code>struct Rgb(u8, u8, u8)</code>. This
627 call must be followed by zero or more calls to <code>serialize_field</code>, then a
628 call to <code>end</code>.</p>
629 <p>The <code>name</code> is the name of the tuple struct and the <code>len</code> is the number
630 of data fields that will be serialized.</p>
631
632 <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">use </span>serde::ser::{Serialize, SerializeTupleStruct, Serializer};
633
634 <span class="kw">struct </span>Rgb(u8, u8, u8);
635
636 <span class="kw">impl </span>Serialize <span class="kw">for </span>Rgb {
637 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
638 <span class="kw">where
639 </span>S: Serializer,
640 {
641 <span class="kw">let </span><span class="kw-2">mut </span>ts = serializer.serialize_tuple_struct(<span class="string">"Rgb"</span>, <span class="number">3</span>)<span class="question-mark">?</span>;
642 ts.serialize_field(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">0</span>)<span class="question-mark">?</span>;
643 ts.serialize_field(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">1</span>)<span class="question-mark">?</span>;
644 ts.serialize_field(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="number">2</span>)<span class="question-mark">?</span>;
645 ts.end()
646 }
647 }</code></pre></div>
648 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_tuple_variant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1119-1125">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_variant" class="fn">serialize_tuple_variant</a>(
649 self,
650 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
651 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
652 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
653 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
654 ) -&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.Serializer.html#associatedtype.SerializeTupleVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleVariant">SerializeTupleVariant</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a tuple variant like <code>E::T</code> in <code>enum E { T(u8, u8) }</code>. This call must be followed by zero or more calls to
655 <code>serialize_field</code>, then a call to <code>end</code>.</p>
656 <p>The <code>name</code> is the name of the enum, the <code>variant_index</code> is the index of
657 this variant within the enum, the <code>variant</code> is the name of the variant,
658 and the <code>len</code> is the number of data fields that will be serialized.</p>
659
660 <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">use </span>serde::ser::{Serialize, SerializeTupleVariant, Serializer};
661
662 <span class="kw">enum </span>E {
663 T(u8, u8),
664 U(String, u32, u32),
665 }
666
667 <span class="kw">impl </span>Serialize <span class="kw">for </span>E {
668 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
669 <span class="kw">where
670 </span>S: Serializer,
671 {
672 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
673 E::T(<span class="kw-2">ref </span>a, <span class="kw-2">ref </span>b) =&gt; {
674 <span class="kw">let </span><span class="kw-2">mut </span>tv = serializer.serialize_tuple_variant(<span class="string">"E"</span>, <span class="number">0</span>, <span class="string">"T"</span>, <span class="number">2</span>)<span class="question-mark">?</span>;
675 tv.serialize_field(a)<span class="question-mark">?</span>;
676 tv.serialize_field(b)<span class="question-mark">?</span>;
677 tv.end()
678 }
679 E::U(<span class="kw-2">ref </span>a, <span class="kw-2">ref </span>b, <span class="kw-2">ref </span>c) =&gt; {
680 <span class="kw">let </span><span class="kw-2">mut </span>tv = serializer.serialize_tuple_variant(<span class="string">"E"</span>, <span class="number">1</span>, <span class="string">"U"</span>, <span class="number">3</span>)<span class="question-mark">?</span>;
681 tv.serialize_field(a)<span class="question-mark">?</span>;
682 tv.serialize_field(b)<span class="question-mark">?</span>;
683 tv.serialize_field(c)<span class="question-mark">?</span>;
684 tv.end()
685 }
686 }
687 }
688 }</code></pre></div>
689 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_map" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1173">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_map" class="fn">serialize_map</a>(
690 self,
691 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
692 ) -&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.Serializer.html#associatedtype.SerializeMap" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeMap">SerializeMap</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a map. This call must be followed by zero or more
693 calls to <code>serialize_key</code> and <code>serialize_value</code>, then a call to <code>end</code>.</p>
694 <p>The argument is the number of elements in the map, which may or may not
695 be computable before the map is iterated. Some serializers only support
696 maps whose length is known up front.</p>
697
698 <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">use </span>serde::ser::{Serialize, SerializeMap, Serializer};
699
700 <span class="kw">impl</span>&lt;K, V&gt; Serialize <span class="kw">for </span>HashMap&lt;K, V&gt;
701 <span class="kw">where
702 </span>K: Serialize,
703 V: Serialize,
704 {
705 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
706 <span class="kw">where
707 </span>S: Serializer,
708 {
709 <span class="kw">let </span><span class="kw-2">mut </span>map = serializer.serialize_map(<span class="prelude-val">Some</span>(<span class="self">self</span>.len()))<span class="question-mark">?</span>;
710 <span class="kw">for </span>(k, v) <span class="kw">in </span><span class="self">self </span>{
711 map.serialize_entry(k, v)<span class="question-mark">?</span>;
712 }
713 map.end()
714 }
715 }</code></pre></div>
716 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_struct" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1205-1209">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct" class="fn">serialize_struct</a>(
717 self,
718 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
719 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
720 ) -&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.Serializer.html#associatedtype.SerializeStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStruct">SerializeStruct</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a struct like <code>struct Rgb { r: u8, g: u8, b: u8 }</code>.
721 This call must be followed by zero or more calls to <code>serialize_field</code>,
722 then a call to <code>end</code>.</p>
723 <p>The <code>name</code> is the name of the struct and the <code>len</code> is the number of
724 data fields that will be serialized. <code>len</code> does not include fields
725 which are skipped with <a href="trait.SerializeStruct.html#method.skip_field" title="method bdk_chain::bitcoin::hashes::serde::ser::SerializeStruct::skip_field"><code>SerializeStruct::skip_field</code></a>.</p>
726
727 <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">use </span>serde::ser::{Serialize, SerializeStruct, Serializer};
728
729 <span class="kw">struct </span>Rgb {
730 r: u8,
731 g: u8,
732 b: u8,
733 }
734
735 <span class="kw">impl </span>Serialize <span class="kw">for </span>Rgb {
736 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
737 <span class="kw">where
738 </span>S: Serializer,
739 {
740 <span class="kw">let </span><span class="kw-2">mut </span>rgb = serializer.serialize_struct(<span class="string">"Rgb"</span>, <span class="number">3</span>)<span class="question-mark">?</span>;
741 rgb.serialize_field(<span class="string">"r"</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.r)<span class="question-mark">?</span>;
742 rgb.serialize_field(<span class="string">"g"</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.g)<span class="question-mark">?</span>;
743 rgb.serialize_field(<span class="string">"b"</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.b)<span class="question-mark">?</span>;
744 rgb.end()
745 }
746 }</code></pre></div>
747 </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.serialize_struct_variant" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1249-1255">source</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct_variant" class="fn">serialize_struct_variant</a>(
748 self,
749 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
750 variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
751 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
752 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
753 ) -&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.Serializer.html#associatedtype.SerializeStructVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStructVariant">SerializeStructVariant</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Begin to serialize a struct variant like <code>E::S</code> in <code>enum E { S { r: u8, g: u8, b: u8 } }</code>. This call must be followed by zero or more calls to
754 <code>serialize_field</code>, then a call to <code>end</code>.</p>
755 <p>The <code>name</code> is the name of the enum, the <code>variant_index</code> is the index of
756 this variant within the enum, the <code>variant</code> is the name of the variant,
757 and the <code>len</code> is the number of data fields that will be serialized.
758 <code>len</code> does not include fields which are skipped with
759 <a href="trait.SerializeStructVariant.html#method.skip_field" title="method bdk_chain::bitcoin::hashes::serde::ser::SerializeStructVariant::skip_field"><code>SerializeStructVariant::skip_field</code></a>.</p>
760
761 <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">use </span>serde::ser::{Serialize, SerializeStructVariant, Serializer};
762
763 <span class="kw">enum </span>E {
764 S { r: u8, g: u8, b: u8 },
765 }
766
767 <span class="kw">impl </span>Serialize <span class="kw">for </span>E {
768 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
769 <span class="kw">where
770 </span>S: Serializer,
771 {
772 <span class="kw">match </span><span class="kw-2">*</span><span class="self">self </span>{
773 E::S {
774 <span class="kw-2">ref </span>r,
775 <span class="kw-2">ref </span>g,
776 <span class="kw-2">ref </span>b,
777 } =&gt; {
778 <span class="kw">let </span><span class="kw-2">mut </span>sv = serializer.serialize_struct_variant(<span class="string">"E"</span>, <span class="number">0</span>, <span class="string">"S"</span>, <span class="number">3</span>)<span class="question-mark">?</span>;
779 sv.serialize_field(<span class="string">"r"</span>, r)<span class="question-mark">?</span>;
780 sv.serialize_field(<span class="string">"g"</span>, g)<span class="question-mark">?</span>;
781 sv.serialize_field(<span class="string">"b"</span>, b)<span class="question-mark">?</span>;
782 sv.end()
783 }
784 }
785 }
786 }</code></pre></div>
787 </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.serialize_i128" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#516">source</a><h4 class="code-header">fn <a href="#method.serialize_i128" class="fn">serialize_i128</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize an <code>i128</code> value.</p>
788
789 <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">impl </span>Serialize <span class="kw">for </span>i128 {
790 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
791 <span class="kw">where
792 </span>S: Serializer,
793 {
794 serializer.serialize_i128(<span class="kw-2">*</span><span class="self">self</span>)
795 }
796 }</code></pre></div>
797 <p>The default behavior unconditionally returns an error.</p>
798 </div></details><details class="toggle method-toggle" open><summary><section id="method.serialize_u128" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#623">source</a><h4 class="code-header">fn <a href="#method.serialize_u128" class="fn">serialize_u128</a>(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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Serialize a <code>u128</code> value.</p>
799
800 <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">impl </span>Serialize <span class="kw">for </span>u128 {
801 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
802 <span class="kw">where
803 </span>S: Serializer,
804 {
805 serializer.serialize_u128(<span class="kw-2">*</span><span class="self">self</span>)
806 }
807 }</code></pre></div>
808 <p>The default behavior unconditionally returns an error.</p>
809 </div></details><details class="toggle method-toggle" open><summary><section id="method.collect_seq" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1281-1284">source</a><h4 class="code-header">fn <a href="#method.collect_seq" class="fn">collect_seq</a>&lt;I&gt;(self, iter: I) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
810 I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,
811 &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a>,</div></h4></section></summary><div class="docblock"><p>Collect an iterator as a sequence.</p>
812 <p>The default implementation serializes each item yielded by the iterator
813 using <a href="#tymethod.serialize_seq"><code>serialize_seq</code></a>. Implementors should not need to override this
814 method.</p>
815
816 <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">use </span>serde::{Serialize, Serializer};
817
818 <span class="kw">struct </span>SecretlyOneHigher {
819 data: Vec&lt;i32&gt;,
820 }
821
822 <span class="kw">impl </span>Serialize <span class="kw">for </span>SecretlyOneHigher {
823 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
824 <span class="kw">where
825 </span>S: Serializer,
826 {
827 serializer.collect_seq(<span class="self">self</span>.data.iter().map(|x| x + <span class="number">1</span>))
828 }
829 }</code></pre></div>
830 </div></details><details class="toggle method-toggle" open><summary><section id="method.collect_map" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1318-1322">source</a><h4 class="code-header">fn <a href="#method.collect_map" class="fn">collect_map</a>&lt;K, V, I&gt;(self, iter: I) -&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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
831 K: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a>,
832 V: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a>,
833 I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(K, V)</a>&gt;,</div></h4></section></summary><div class="docblock"><p>Collect an iterator as a map.</p>
834 <p>The default implementation serializes each pair yielded by the iterator
835 using <a href="#tymethod.serialize_map"><code>serialize_map</code></a>. Implementors should not need to override this
836 method.</p>
837
838 <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">use </span>serde::{Serialize, Serializer};
839 <span class="kw">use </span>std::collections::BTreeSet;
840
841 <span class="kw">struct </span>MapToUnit {
842 keys: BTreeSet&lt;i32&gt;,
843 }
844
845 <span class="comment">// Serializes as a map in which the values are all unit.
846 </span><span class="kw">impl </span>Serialize <span class="kw">for </span>MapToUnit {
847 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
848 <span class="kw">where
849 </span>S: Serializer,
850 {
851 serializer.collect_map(<span class="self">self</span>.keys.iter().map(|k| (k, ())))
852 }
853 }</code></pre></div>
854 </div></details><details class="toggle method-toggle" open><summary><section id="method.collect_str" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1359-1361">source</a><h4 class="code-header">fn <a href="#method.collect_str" class="fn">collect_str</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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.Serializer.html#associatedtype.Ok" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Ok">Ok</a>, Self::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.Error" title="type bdk_chain::bitcoin::hashes::serde::Serializer::Error">Error</a>&gt;<div class="where">where
855 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Serialize a string produced by an implementation of <code>Display</code>.</p>
856 <p>The default implementation builds a heap-allocated <a href="https://doc.rust-lang.org/std/string/struct.String.html"><code>String</code></a> and
857 delegates to <a href="#tymethod.serialize_str"><code>serialize_str</code></a>. Serializers are encouraged to provide a
858 more efficient implementation if possible.</p>
859
860 <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">use </span>serde::{Serialize, Serializer};
861
862 <span class="kw">impl </span>Serialize <span class="kw">for </span>DateTime {
863 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
864 <span class="kw">where
865 </span>S: Serializer,
866 {
867 serializer.collect_str(<span class="kw-2">&amp;</span><span class="macro">format_args!</span>(<span class="string">"{:?}{:?}"</span>, <span class="self">self</span>.naive_local(), <span class="self">self</span>.offset()))
868 }
869 }</code></pre></div>
870 </div></details><details class="toggle method-toggle" open><summary><section id="method.is_human_readable" class="method"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/mod.rs.html#1445">source</a><h4 class="code-header">fn <a href="#method.is_human_readable" class="fn">is_human_readable</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determine whether <code>Serialize</code> implementations should serialize in
871 human-readable form.</p>
872 <p>Some types have a human-readable form that may be somewhat expensive to
873 construct, as well as a binary form that is compact and efficient.
874 Generally text-based formats like JSON and YAML will prefer to use the
875 human-readable one and binary formats like Postcard will prefer the
876 compact one.</p>
877
878 <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">use </span>serde::{Serialize, Serializer};
879
880 <span class="kw">impl </span>Serialize <span class="kw">for </span>Timestamp {
881 <span class="kw">fn </span>serialize&lt;S&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, serializer: S) -&gt; <span class="prelude-ty">Result</span>&lt;S::Ok, S::Error&gt;
882 <span class="kw">where
883 </span>S: Serializer,
884 {
885 <span class="kw">if </span>serializer.is_human_readable() {
886 <span class="comment">// Serialize to a human-readable string "2015-05-15T17:01:00Z".
887 </span><span class="self">self</span>.to_string().serialize(serializer)
888 } <span class="kw">else </span>{
889 <span class="comment">// Serialize to a compact binary representation.
890 </span><span class="self">self</span>.seconds_since_epoch().serialize(serializer)
891 }
892 }
893 }</code></pre></div>
894 <p>The default implementation of this method returns <code>true</code>. Data formats
895 may override this to <code>false</code> to request a compact form for types that
896 support one. Note that modifying this method to change a format from
897 human-readable to compact or vice versa should be regarded as a breaking
898 change, as a value serialized in human-readable mode is not required to
899 deserialize from the same data in compact mode.</p>
900 </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="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Serializer-for-Serializer" class="impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#60">source</a><a href="#impl-Serializer-for-Serializer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a> for <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Ok-1" class="associatedtype trait-impl"><a href="#associatedtype.Ok-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Ok" class="associatedtype">Ok</a> = <a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a></h4></section><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a></h4></section><section id="associatedtype.SerializeSeq-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeSeq-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeSeq" class="associatedtype">SerializeSeq</a> = SerializeVec</h4></section><section id="associatedtype.SerializeTuple-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTuple-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTuple" class="associatedtype">SerializeTuple</a> = SerializeVec</h4></section><section id="associatedtype.SerializeTupleStruct-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleStruct-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleStruct" class="associatedtype">SerializeTupleStruct</a> = SerializeVec</h4></section><section id="associatedtype.SerializeTupleVariant-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleVariant-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleVariant" class="associatedtype">SerializeTupleVariant</a> = SerializeTupleVariant</h4></section><section id="associatedtype.SerializeMap-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeMap-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeMap" class="associatedtype">SerializeMap</a> = SerializeMap</h4></section><section id="associatedtype.SerializeStruct-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStruct-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStruct" class="associatedtype">SerializeStruct</a> = SerializeMap</h4></section><section id="associatedtype.SerializeStructVariant-1" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStructVariant-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStructVariant" class="associatedtype">SerializeStructVariant</a> = SerializeStructVariant</h4></section><section id="method.serialize_bool" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#73">source</a><a href="#method.serialize_bool" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bool" class="fn">serialize_bool</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i8" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#78">source</a><a href="#method.serialize_i8" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i8" class="fn">serialize_i8</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i16" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#83">source</a><a href="#method.serialize_i16" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i16" class="fn">serialize_i16</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i32" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#88">source</a><a href="#method.serialize_i32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i32" class="fn">serialize_i32</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i64" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#92">source</a><a href="#method.serialize_i64" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i64" class="fn">serialize_i64</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i128-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#96">source</a><a href="#method.serialize_i128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_i128" class="fn">serialize_i128</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u8" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#115">source</a><a href="#method.serialize_u8" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u8" class="fn">serialize_u8</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u16" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#120">source</a><a href="#method.serialize_u16" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u16" class="fn">serialize_u16</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u32" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#125">source</a><a href="#method.serialize_u32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u32" class="fn">serialize_u32</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u64" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#130">source</a><a href="#method.serialize_u64" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u64" class="fn">serialize_u64</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u128-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#134">source</a><a href="#method.serialize_u128-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_u128" class="fn">serialize_u128</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_f32" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#151">source</a><a href="#method.serialize_f32" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f32" class="fn">serialize_f32</a>(self, float: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_f64" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#156">source</a><a href="#method.serialize_f64" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f64" class="fn">serialize_f64</a>(self, float: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_char" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#161">source</a><a href="#method.serialize_char" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_char" class="fn">serialize_char</a>(self, value: <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_str" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#168">source</a><a href="#method.serialize_str" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_str" class="fn">serialize_str</a>(self, value: &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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_bytes" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#172">source</a><a href="#method.serialize_bytes" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bytes" class="fn">serialize_bytes</a>(self, value: &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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#178">source</a><a href="#method.serialize_unit" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit" class="fn">serialize_unit</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit_struct" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#183">source</a><a href="#method.serialize_unit_struct" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_struct" class="fn">serialize_unit_struct</a>(self, _name: &amp;'static <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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit_variant" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#188-193">source</a><a href="#method.serialize_unit_variant" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_variant" class="fn">serialize_unit_variant</a>(
901 self,
902 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
903 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
904 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
905 ) -&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="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_newtype_struct" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#198-200">source</a><a href="#method.serialize_newtype_struct" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_struct" class="fn">serialize_newtype_struct</a>&lt;T&gt;(
906 self,
907 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
908 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
909 ) -&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="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
910 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_newtype_variant" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#205-213">source</a><a href="#method.serialize_newtype_variant" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_variant" class="fn">serialize_newtype_variant</a>&lt;T&gt;(
911 self,
912 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
913 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
914 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
915 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
916 ) -&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="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
917 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_none" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#221">source</a><a href="#method.serialize_none" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_none" class="fn">serialize_none</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_some" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#226-228">source</a><a href="#method.serialize_some" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_some" class="fn">serialize_some</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
918 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_seq" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#233">source</a><a href="#method.serialize_seq" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_seq" class="fn">serialize_seq</a>(
919 self,
920 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
921 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeSeq" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeSeq">SerializeSeq</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#239">source</a><a href="#method.serialize_tuple" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple" class="fn">serialize_tuple</a>(
922 self,
923 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
924 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTuple" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTuple">SerializeTuple</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple_struct" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#243-247">source</a><a href="#method.serialize_tuple_struct" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_struct" class="fn">serialize_tuple_struct</a>(
925 self,
926 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
927 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
928 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleStruct">SerializeTupleStruct</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple_variant" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#251-257">source</a><a href="#method.serialize_tuple_variant" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_variant" class="fn">serialize_tuple_variant</a>(
929 self,
930 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
931 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
932 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
933 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
934 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleVariant">SerializeTupleVariant</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_map" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#264">source</a><a href="#method.serialize_map" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_map" class="fn">serialize_map</a>(
935 self,
936 _len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
937 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeMap" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeMap">SerializeMap</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_struct" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#271">source</a><a href="#method.serialize_struct" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct" class="fn">serialize_struct</a>(
938 self,
939 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
940 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
941 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStruct">SerializeStruct</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_struct_variant" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#281-287">source</a><a href="#method.serialize_struct_variant" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct_variant" class="fn">serialize_struct_variant</a>(
942 self,
943 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
944 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
945 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
946 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
947 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/value/ser/struct.Serializer.html" title="struct serde_json::value::ser::Serializer">Serializer</a> as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStructVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStructVariant">SerializeStructVariant</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.collect_str-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/value/ser.rs.html#294-296">source</a><a href="#method.collect_str-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.collect_str" class="fn">collect_str</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<a class="enum" href="https://docs.rs/serde_json/1.0.128/serde_json/value/enum.Value.html" title="enum serde_json::value::Value">Value</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
948 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Serializer-for-%26mut+Formatter%3C'b%3E" class="impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#38">source</a><a href="#impl-Serializer-for-%26mut+Formatter%3C'b%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, 'b&gt; <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a> for &amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt;</h3></section></summary><div class="docblock">
949 <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">use </span>serde::ser::Serialize;
950 <span class="kw">use </span>serde_derive::Serialize;
951 <span class="kw">use </span>std::fmt::{<span class="self">self</span>, Display};
952
953 <span class="attr">#[derive(Serialize)]
954 #[serde(rename_all = <span class="string">"kebab-case"</span>)]
955 </span><span class="kw">pub enum </span>MessageType {
956 StartRequest,
957 EndRequest,
958 }
959
960 <span class="kw">impl </span>Display <span class="kw">for </span>MessageType {
961 <span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>fmt::Formatter) -&gt; fmt::Result {
962 <span class="self">self</span>.serialize(f)
963 }
964 }</code></pre></div>
965 </div><div class="impl-items"><section id="associatedtype.Ok-2" class="associatedtype trait-impl"><a href="#associatedtype.Ok-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Ok" class="associatedtype">Ok</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section><section id="associatedtype.Error-2" class="associatedtype trait-impl"><a href="#associatedtype.Error-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a></h4></section><section id="associatedtype.SerializeSeq-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeSeq-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeSeq" class="associatedtype">SerializeSeq</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeTuple-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTuple-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTuple" class="associatedtype">SerializeTuple</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeTupleStruct-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleStruct-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleStruct" class="associatedtype">SerializeTupleStruct</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeTupleVariant-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleVariant-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleVariant" class="associatedtype">SerializeTupleVariant</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeMap-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeMap-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeMap" class="associatedtype">SerializeMap</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeStruct-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStruct-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStruct" class="associatedtype">SerializeStruct</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="associatedtype.SerializeStructVariant-2" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStructVariant-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStructVariant" class="associatedtype">SerializeStructVariant</a> = <a class="struct" href="struct.Impossible.html" title="struct bdk_chain::bitcoin::hashes::serde::ser::Impossible">Impossible</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><section id="method.serialize_bool-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_bool-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bool" class="fn">serialize_bool</a>(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;<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><section id="method.serialize_i8-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_i8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i8" class="fn">serialize_i8</a>(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;<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><section id="method.serialize_i16-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_i16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i16" class="fn">serialize_i16</a>(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;<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><section id="method.serialize_i32-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_i32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i32" class="fn">serialize_i32</a>(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;<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><section id="method.serialize_i64-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_i64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i64" class="fn">serialize_i64</a>(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;<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><section id="method.serialize_i128-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_i128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_i128" class="fn">serialize_i128</a>(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;<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><section id="method.serialize_u8-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_u8-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u8" class="fn">serialize_u8</a>(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;<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><section id="method.serialize_u16-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_u16-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u16" class="fn">serialize_u16</a>(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;<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><section id="method.serialize_u32-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_u32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u32" class="fn">serialize_u32</a>(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;<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><section id="method.serialize_u64-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_u64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u64" class="fn">serialize_u64</a>(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;<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><section id="method.serialize_u128-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_u128-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_u128" class="fn">serialize_u128</a>(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;<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><section id="method.serialize_f32-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_f32-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f32" class="fn">serialize_f32</a>(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;<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><section id="method.serialize_f64-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_f64-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f64" class="fn">serialize_f64</a>(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;<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><section id="method.serialize_char-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_char-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_char" class="fn">serialize_char</a>(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;<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><section id="method.serialize_str-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_str-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_str" class="fn">serialize_str</a>(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;<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><section id="method.serialize_unit_struct-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#49-66">source</a><a href="#method.serialize_unit_struct-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_struct" class="fn">serialize_unit_struct</a>(self, v: &amp;'static <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;<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><section id="method.serialize_unit_variant-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#68-73">source</a><a href="#method.serialize_unit_variant-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_variant" class="fn">serialize_unit_variant</a>(
966 self,
967 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
968 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
969 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
970 ) -&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><section id="method.serialize_newtype_struct-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#77-79">source</a><a href="#method.serialize_newtype_struct-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_struct" class="fn">serialize_newtype_struct</a>&lt;T&gt;(
971 self,
972 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
973 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
974 ) -&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;<div class="where">where
975 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_bytes-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#84">source</a><a href="#method.serialize_bytes-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bytes" class="fn">serialize_bytes</a>(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;<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><section id="method.serialize_none-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#88">source</a><a href="#method.serialize_none-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_none" class="fn">serialize_none</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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><section id="method.serialize_some-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#92-94">source</a><a href="#method.serialize_some-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_some" class="fn">serialize_some</a>&lt;T&gt;(self, _value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<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;<div class="where">where
976 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_unit-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#99">source</a><a href="#method.serialize_unit-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit" class="fn">serialize_unit</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<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><section id="method.serialize_newtype_variant-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#103-111">source</a><a href="#method.serialize_newtype_variant-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_variant" class="fn">serialize_newtype_variant</a>&lt;T&gt;(
977 self,
978 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
979 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
980 _variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
981 _value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
982 ) -&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;<div class="where">where
983 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_seq-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#116">source</a><a href="#method.serialize_seq-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_seq" class="fn">serialize_seq</a>(
984 self,
985 _len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
986 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeSeq" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeSeq">SerializeSeq</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><section id="method.serialize_tuple-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#120">source</a><a href="#method.serialize_tuple-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple" class="fn">serialize_tuple</a>(
987 self,
988 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
989 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTuple" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTuple">SerializeTuple</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><section id="method.serialize_tuple_struct-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#124-128">source</a><a href="#method.serialize_tuple_struct-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_struct" class="fn">serialize_tuple_struct</a>(
990 self,
991 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
992 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
993 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleStruct">SerializeTupleStruct</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><section id="method.serialize_tuple_variant-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#132-138">source</a><a href="#method.serialize_tuple_variant-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_variant" class="fn">serialize_tuple_variant</a>(
994 self,
995 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
996 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
997 _variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
998 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
999 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleVariant">SerializeTupleVariant</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><section id="method.serialize_map-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#142">source</a><a href="#method.serialize_map-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_map" class="fn">serialize_map</a>(
1000 self,
1001 _len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
1002 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeMap" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeMap">SerializeMap</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><section id="method.serialize_struct-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#146-150">source</a><a href="#method.serialize_struct-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct" class="fn">serialize_struct</a>(
1003 self,
1004 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1005 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1006 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStruct">SerializeStruct</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><section id="method.serialize_struct_variant-1" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#154-160">source</a><a href="#method.serialize_struct_variant-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct_variant" class="fn">serialize_struct_variant</a>(
1007 self,
1008 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1009 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
1010 _variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1011 _len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1012 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'b&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStructVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStructVariant">SerializeStructVariant</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><section id="method.collect_str-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde/1.0.210/src/serde/ser/fmt.rs.html#164-166">source</a><a href="#method.collect_str-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.collect_str" class="fn">collect_str</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<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;<div class="where">where
1013 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Serializer-for-%26mut+Serializer%3CW,+F%3E" class="impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#59-62">source</a><a href="#impl-Serializer-for-%26mut+Serializer%3CW,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, W, F&gt; <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a> for &amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt;<div class="where">where
1014 W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a>,
1015 F: <a class="trait" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/trait.Formatter.html" title="trait serde_json::ser::Formatter">Formatter</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.serialize_newtype_struct-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#221-223">source</a><a href="#method.serialize_newtype_struct-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_struct" class="fn">serialize_newtype_struct</a>&lt;T&gt;(
1016 self,
1017 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1018 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
1019 ) -&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://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
1020 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Serialize newtypes without an object wrapper.</p>
1021 </div></details><section id="associatedtype.Ok-3" class="associatedtype trait-impl"><a href="#associatedtype.Ok-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Ok" class="associatedtype">Ok</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section><section id="associatedtype.Error-3" class="associatedtype trait-impl"><a href="#associatedtype.Error-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a></h4></section><section id="associatedtype.SerializeSeq-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeSeq-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeSeq" class="associatedtype">SerializeSeq</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeTuple-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTuple-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTuple" class="associatedtype">SerializeTuple</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeTupleStruct-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleStruct-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleStruct" class="associatedtype">SerializeTupleStruct</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeTupleVariant-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeTupleVariant-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeTupleVariant" class="associatedtype">SerializeTupleVariant</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeMap-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeMap-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeMap" class="associatedtype">SerializeMap</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeStruct-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStruct-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStruct" class="associatedtype">SerializeStruct</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="associatedtype.SerializeStructVariant-3" class="associatedtype trait-impl"><a href="#associatedtype.SerializeStructVariant-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.SerializeStructVariant" class="associatedtype">SerializeStructVariant</a> = Compound&lt;'a, W, F&gt;</h4></section><section id="method.serialize_bool-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#76">source</a><a href="#method.serialize_bool-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bool" class="fn">serialize_bool</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i8-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#83">source</a><a href="#method.serialize_i8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i8" class="fn">serialize_i8</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i16-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#90">source</a><a href="#method.serialize_i16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i16" class="fn">serialize_i16</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i32-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#97">source</a><a href="#method.serialize_i32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i32" class="fn">serialize_i32</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i64-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#104">source</a><a href="#method.serialize_i64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_i64" class="fn">serialize_i64</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_i128-3" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#110">source</a><a href="#method.serialize_i128-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_i128" class="fn">serialize_i128</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u8-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#117">source</a><a href="#method.serialize_u8-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u8" class="fn">serialize_u8</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u16-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#124">source</a><a href="#method.serialize_u16-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u16" class="fn">serialize_u16</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u32-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#131">source</a><a href="#method.serialize_u32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u32" class="fn">serialize_u32</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u64-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#138">source</a><a href="#method.serialize_u64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_u64" class="fn">serialize_u64</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_u128-3" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#144">source</a><a href="#method.serialize_u128-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.serialize_u128" class="fn">serialize_u128</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_f32-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#151">source</a><a href="#method.serialize_f32-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f32" class="fn">serialize_f32</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_f64-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#165">source</a><a href="#method.serialize_f64-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_f64" class="fn">serialize_f64</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_char-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#179">source</a><a href="#method.serialize_char-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_char" class="fn">serialize_char</a>(self, value: <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_str-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#186">source</a><a href="#method.serialize_str-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_str" class="fn">serialize_str</a>(self, value: &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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_bytes-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#191">source</a><a href="#method.serialize_bytes-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_bytes" class="fn">serialize_bytes</a>(self, value: &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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#198">source</a><a href="#method.serialize_unit-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit" class="fn">serialize_unit</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit_struct-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#205">source</a><a href="#method.serialize_unit_struct-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_struct" class="fn">serialize_unit_struct</a>(self, _name: &amp;'static <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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_unit_variant-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#210-215">source</a><a href="#method.serialize_unit_variant-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_unit_variant" class="fn">serialize_unit_variant</a>(
1022 self,
1023 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1024 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
1025 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>
1026 ) -&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://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_newtype_variant-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#229-237">source</a><a href="#method.serialize_newtype_variant-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_newtype_variant" class="fn">serialize_newtype_variant</a>&lt;T&gt;(
1027 self,
1028 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1029 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
1030 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1031 value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a>
1032 ) -&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://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
1033 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_none-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#267">source</a><a href="#method.serialize_none-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_none" class="fn">serialize_none</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_some-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#272-274">source</a><a href="#method.serialize_some-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_some" class="fn">serialize_some</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
1034 T: <a class="trait" href="../trait.Serialize.html" title="trait bdk_chain::bitcoin::hashes::serde::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section><section id="method.serialize_seq-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#280">source</a><a href="#method.serialize_seq-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_seq" class="fn">serialize_seq</a>(
1035 self,
1036 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
1037 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeSeq" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeSeq">SerializeSeq</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#303">source</a><a href="#method.serialize_tuple-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple" class="fn">serialize_tuple</a>(
1038 self,
1039 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1040 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTuple" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTuple">SerializeTuple</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple_struct-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#308-312">source</a><a href="#method.serialize_tuple_struct-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_struct" class="fn">serialize_tuple_struct</a>(
1041 self,
1042 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1043 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1044 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleStruct">SerializeTupleStruct</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_tuple_variant-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#317-323">source</a><a href="#method.serialize_tuple_variant-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_tuple_variant" class="fn">serialize_tuple_variant</a>(
1045 self,
1046 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1047 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
1048 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1049 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1050 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeTupleVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeTupleVariant">SerializeTupleVariant</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_map-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#345">source</a><a href="#method.serialize_map-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_map" class="fn">serialize_map</a>(
1051 self,
1052 len: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;
1053 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeMap" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeMap">SerializeMap</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_struct-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#368">source</a><a href="#method.serialize_struct-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct" class="fn">serialize_struct</a>(
1054 self,
1055 name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1056 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1057 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStruct" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStruct">SerializeStruct</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.serialize_struct_variant-2" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#379-385">source</a><a href="#method.serialize_struct_variant-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.serialize_struct_variant" class="fn">serialize_struct_variant</a>(
1058 self,
1059 _name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1060 _variant_index: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>,
1061 variant: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
1062 len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>
1063 ) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;&amp;'a mut <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/ser/struct.Serializer.html" title="struct serde_json::ser::Serializer">Serializer</a>&lt;W, F&gt; as <a class="trait" href="../trait.Serializer.html" title="trait bdk_chain::bitcoin::hashes::serde::Serializer">Serializer</a>&gt;::<a class="associatedtype" href="../trait.Serializer.html#associatedtype.SerializeStructVariant" title="type bdk_chain::bitcoin::hashes::serde::Serializer::SerializeStructVariant">SerializeStructVariant</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;</h4></section><section id="method.collect_str-3" class="method trait-impl"><a class="src rightside" href="https://docs.rs/serde_json/1.0.128/src/serde_json/ser.rs.html#406-408">source</a><a href="#method.collect_str-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.collect_str" class="fn">collect_str</a>&lt;T&gt;(self, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</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;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://docs.rs/serde_json/1.0.128/serde_json/error/struct.Error.html" title="struct serde_json::error::Error">Error</a>&gt;<div class="where">where
1064 T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../../../trait.impl/serde/ser/trait.Serializer.js" data-ignore-extern-crates="core,serde_json" async></script></section></div></main></body></html>